Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira Automation To Parse Description Field

chadunbehaun March 21, 2025

I am trying to write a very simple automation to parse the description field from a story that contains the text 1:2:3:4 and use the Log action to output its empty status, size, and each list item.  What I am seeing is that when I run it, I can output the string in the description, it tells me the smart value is not empty and I can't output the first list item from the split command when I try {{row.get(0)}}.  Any idea what I am missing?  Every example that I have tried has the same result.


Thanks!!!!

 

automation_1.PNGautomation_2.PNGautomation_3.PNG

1 answer

1 accepted

0 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 21, 2025

Hi @chadunbehaun 

Created variables are always text type.  And when you split() the Description field, the result is the rows variable gets this:

  • first the Description is split into a list of text values: [1, 2, 3, 4]
  • and because it is then stored in text, it implicitly performs a join(", ")
  • with a result of: 1, 2, 3, 4

When you later want to return to a list, the split() command is needed again.  For example, to get the size:

{{rows.split(", ").size}}

 

Tip: The implicit join() is undocumented type conversion behavior, and so I recommend explicitly adding a join() with your desired delimiter to always know what is in there.

 

Kind regards,
Bill

chadunbehaun March 21, 2025

Thank you for the quick response.  Very much appreciated.  That being the case, then how do you reference a row in a advanced branch then?  Assuming the smart value for the branch is still {{issue.description.split(":")}}?

Like Bill Sheboy likes this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 21, 2025

Yes, that is one way to do it:

  • advanced branch:
    • smart value: {{issue.description.split(":")}}
    • name: varItem

And inside the branch, reference the item as {{varItem}}

 

Please note well: this assumes there is at least a non-empty Description field with a colon ":" delimiter and no newlines in the field.

  • When no data is in the field, the branch will not process anything
  • When the branch contains newlines, it may not split() as you expect

The solution is to always test to confirm the behavior matches what you plan.

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events