Forums

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

In Jira automation, how can I get just the sprint name using the fieldchange.tostring smart values?

Cash Coyne
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.
February 17, 2023

In Jira automation in Jira Cloud, how can I get just the sprint name using the fieldChange.fromString/fieldchange.tostring smart values?

Currently, I have a rule that sends an email when the value of the Sprint field changes.  I want to have the name of the sprint before it was changed and the name after it was changed, so I use these smart values:

{{fieldChange.fromString}}

{{fieldChange.toString}}

But, they provide way too much.  For example, this is what I get for them

[{id=2168, name=Engineering Sprint 7, state=closed, boardId=400, goal=, startDate=2023-01-17T20:51:25.239Z, endDate=2023-01-31T20:13:00.000Z, completeDate=2023-01-31T20:19:26.859Z}, {id=2190, name=Engineering Sprint 8, state=active, boardId=400, goal=, startDate=2023-01-31T21:17:12.215Z, endDate=2023-02-14T21:29:00.000Z}]

All I want is the name value for the sprint.  I tried these smart values, but they return nothing:

{{fieldChange.fromString.name}}

{{fieldChange.toString.name}}

How can I get just the name of the sprint before and after it was changed?

 

 

2 answers

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.
February 17, 2023

Hi @Cash Coyne 

I suggest using the match() function with a regular expression to pull out just the name value from the text: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#match--

Kind regards,
Bill

0 votes
Riley Venable
Community Champion
February 17, 2023
You can use the substringBefore() function to get the name of the sprint before and after it was changed. For example, if your smart value is {{fieldChange.fromString}}, then change it to {{fieldChange.fromString.substringBefore("{adf")}}. This will ensure that the name of the sprint before it was changed is hidden. You can use the same function for the {{fieldChange.toString}} smart value.

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