Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Getting Text of ProForma multiple choice Values via Jira Automation and Assets

Gleiciany Alves Cardoso
Contributor
October 23, 2023

Retrieving a value (text) from the ProForma form

Currently, Proforma only keeps the ID of the list field in the JSON and returns the associated value when the form is displayed. Therefore, due to only obtaining the ID of the selected option (not the response itself), unfortunately accessing the list field values does not work for smart values. This is a known limitation.

However, after conducting extensive research and testing, I found a very effective solution where it is possible to retrieve the value of the selected option (yes, retrieve the text of the option) using Jira Automation and Assets. Assets will function in this scenario as an information repository and for each object, it will provide me with an ID which I will link in the automation so that Jira Automation can correlate the Proforma ID to the object ID in Assets.

Why use Assets?

By creating a custom field using Assets, it is possible to obtain the values (text) of the field through the Key (custom number) of the object. In other words, the mission in the automation is to locate the Key (example: BSM-1234) of the object through the JSON that ProForma provided. It is worth noting that it will only be possible to locate the Assets object ID if you link a custom field in the form in the format "Assets" (or insights).

What is the logic in using Assets for this?

By observing the structure of the JSON provided by ProForma, I identified that only the number after the ":" (colon) is variable. In other words, the initial structure remains, so what I need to do is map the structured information in Assets to the ID that ProForma provides me with.


USING ASSETS

In my case, our Support team has severity matrices based on the product, and therefore, each type of issue has a different severity for priorities such as High, Blocker, Medium, and Low.

Based on this, I structured a schema to have:

  • My product > Business Flow and Type Of Issue by product and related each type to its severity
    artigo-assets.png 

5360.png

 

Finding the object number in JSON ProForma:

Look in the “Entite Properties” (JSON) of the ticket for the value after the “:”

id-assets-2.png

Note that only the numbers after the ":" (colon) change and the initial structure remains!


JIRA Automation - Creating the automation

After structuring Assets with the information I need to search via automation, I started creating the logic:

  • Trigger: in the example, I set it to be manual for testing purposes.  trigger-jira.PNG
  • Create variable: at this stage, I will insert a variable in the automation so that it can search in the "Entite properties" (JSON) of the ticket for the value after the ":". For this, I used the split in the automation (as shown in the print).

    JSON - ticket:
    proforma-id-assets.png
    Variable in automation:
    {{issue.properties."proforma.forms.i1".state.answers.6.choices.get(0).split(":").last}}
    variable-2.png
  • Logs: to track the values that the automation was finding, I added two logs: 1. for the ID number and the other to search for the complete ID with letters (the latter must be identical to the object ID in Assets. For example: BSM-1234)
  • Now, I added the "Lookup Objects" action: I selected the schema where my objects are structured and in the query I placed the search as follows: "Key = BSM-{{updatebusinessflow}}", where "Key" is the key of my object (object in this case will be the option chosen in the portal. Example of the object text: I need to reset my password) and "{{updatebusinessflow}}" is the variable that I already searched:

    lookup-objects.png

  • Editing a specific field: Now that I have found the text using the variable to access the ProForma JSON and the lookup Objects to locate the text related to the Key, the last condition is to insert the found value in a common field (text type) in the Jira ticket. For this, I used "Edit fields", selected the field "[New] Business Flow" and inserted the smart value {{lookupObjects.BFName.BFN}}. In other words, I asked the automation to insert in the specific field the value that I located through the search in the object from the Key:
    edit.png

log-success.png

I hope this article helped you!
Thanks :)

0 comments

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events