Map returned table values to friendly values

Forgive me as I don't have much javascript background. I'm working in retool to create a simple issue lookup tool which pulls from our jira api. I've created a simple table return of 3 columns based on an issue key lookup. From this, one of the columns is "status". The value which returns is internal developer jargon which I want to convert to a more friendly name which some other consumers can benefit from. It seems I should be able to do this through "mapped value" in the column settings, but I've yet to find a reasonable example to build from.

Here's what I'm expecting

Example data return:
Summary - Broken thing
Status - Dev Support Backlog
Last updated - 1979-05-25

What I'd like to display to my users
Example data return:
Summary - Broken thing
Status - Evaluating
Last updated - 1979-05-25

This is just one example of a status that needs translated to a different string. So I'm thinking it needs to be something like..

if{{issue.data.fields.status.name}} = "Dev Support Backlog"
   then "Evaluating"
      else if {{issue.data.fields.status.name}} = "Assigned"
           then "In Progress"

I understand this is completely bunk "code", but hopefully it displays what I'm trying to accomplish. Any help is appreciated

1 Like

Hi @mbaczynski, welcome to the community :wave:

You can just go by with this on your 'mapped value' field:
{{ self === "Dev Support Backload" ? "Evaluating" : self === "Assigned" ? "In Progress" : "No Action Yet" }} .

Check this doc on ternary operator for the explanation. The "No Action Yet" is a make up client-facing status I just placed there if the value is neither of the mentioned status.

2 Likes

Awesome. I'll give this a try. Thank you!

@mbaczynski hello. How were you able to do this:
"I'm working in retool to create a simple issue lookup tool which pulls from our jira api. I've created a simple table return of 3 columns based on an issue key lookup"

Thank you

Closing the loop here. I just did what was suggested. {{ self === "Dev Support Backload" ? "Evaluating" : self === "Assigned" ? "In Progress" : "No Action Yet" }} .

1 Like