• DOCUMENTATION
  • WORKATO BLOG
  • PRODUCT BLOG
  • Return to Workato
  • Log in
  • ☰
  • Community/Discussions
Solution home App Resources JIRA

How to Deal With JIRA Listbox Fields

Modified on: Wed, Aug 3, 2016 at 7:00 PM

Sometimes, JIRA list box data pills come up looking strange. Here's an example:


{"self"=>"https://jira.xyz.com/rest/api/2/customFieldOption/123", "value"=>"Acceptable", "id"=>"123”}


What is it, and how do we fix it? 


Firstly, this means that your Workato recipe is getting a JIRA value from a list box like this:

  

OPTIONS:
Acceptable
Unacceptable

 

JIRA stores the option, "Acceptable", as a data point with a unique ID of "123", and a value of "Acceptable".

 

{"self"=>"https://jira.xyz.com/rest/api/2/customFieldOption/123", "value"=>"Acceptable", "id"=>"123”}

 

In order for Workato to choose the right option, the recipe needs to know the "value". To extract "Acceptable" out of this example, we can use formula mode. Here's one way that it could be accomplished (replaced OPTIONS with the Workato data pill):

   

OPTIONS.to_s.split("value=\"")[1].split("\"")[0]

   

If you run the recipe now, you will get "Acceptable". Great!


However, one more step is required for Workato to choose the right dropdown option. For instance, Workato may understand the list's values like this:

 

option_accept: "Acceptable",
option_refuse: "Unacceptable"

 

In this example, we would still need to fill in "option_accept" in order for Workato to choose "Acceptable". To find out what each value is mapped to, click the blue button on the right of the list field to switch between the list value and custom value.


To do so, we can map values like this:

 

{"Acceptable" => "option_accept", "Unacceptable" => "option_reject"}[OPTIONS.to_s.split("value=\"")[1].split("\"")[0]]

   

Now, when we run our Workato recipe, the JIRA field will be properly mapped.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.

Related Articles

    Still can't find your solution?

    Visit our forums to search for answers, or post your own questions.

    Documentation
    Developer's Library
    Tutorials
    eBooks
    Product Hour
    Product Blog
    Workato Blog
    Product updates
    Customer Stories
    © Workato 2020   Privacy   Terms   +1 (844) 469-6752
    • Documentation
    • Workato Blog
    • Product Blog
    • Solutions
    • Forums
    • Tickets
    • Log in
    • Return to Workato