Update Description field on Transition with a smart value

FR Jira Dev March 18, 2021

I am looking to update the description of an issue on a transition with a post function.

The goal is to replace a certain piece of the url with the {{issue.summary.charAt(2)}} from the original ticket summary.

Example: Insert this into the description with the post function the value of the field set to: www.website.com/{{issue.summary.charAt(5)}}/issue

The outcome I would expect from a Issue Summary: Test 3 would be www.website.com/3/issue

but the description is updated and does not convert the smart value. sting www.website.com/{{issue.summary.charAt(5)}}/issue

Any ideas on how to make this execute and fill in the correct number from the summary or other workaround

 

1 answer

1 accepted

1 vote
Answer accepted
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 18, 2021

Hi @FR Jira Dev  - Welcome to the Atlassian Community!

What is it actually returning? 

FR Jira Dev March 19, 2021

Hi John, I actually got it to return correctly with a less than ideal workaround using {{issue.summary.substringBetween("e","s")}} but it makes it so we cannot have spaces in the summary.  What I really want is characters at 5,6 but only if they are numerical values of 1-9, ignore spaces. 

The issue is when here is a single digit example 5 vs 12 it would return correctly.  Is there a way to do this? Right now it is causing an error with a single digit because it returns a digit for char 5 but char 6 is a letter when a single digit.

Example - Size 1 Shirt would return www.website.com/1/issue

But if it was Size 12 Shirt would return www.website.com/12/issue

Using the above it has to have a summary of  Size1 Shirt and Size12 Shirt is required.

Is there an approach to have spaces and only return digits?

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 19, 2021

Hi @FR Jira Dev -- Welcome to the Atlassian Community!

What else is in your summary that you are pulling the value from?

Have you considered using a RegEx expression and the Match() function to pull the values out?

https://support.atlassian.com/jira-software-cloud/docs/smart-values-text-fields/#Smartvalues-textfields-match()


Best regards,

Bill

Like John Funk likes this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 19, 2021

@Bill Sheboy probably has the best suggestion for this, using RegEx expression. 

Suggest an answer

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

Atlassian Community Events