Forums

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

Set the Story Point Field from Summary Text via Regular Expression

Jim Edgeton July 17, 2020

Hello, I'm trying to use Jira Automation to quickly set the story point value of a task by grabbing a numeric value from the Summary field through a regular expression. Does anyone have examples of how to do something like that?

Example:

Creating a Jira task with summary "Deploy code to Production :3:" would trigger this rule, set the Story Point numeric field to 3, and then remove the " :3:" from the Summary field text.

This is what I have so far (see screenshot below), but I'm not sure if I'm doing it right and also next steps of how to put that numeric value into some sort of variable and set the Story Point field to that variable? Lastly, ideally I would then remove the " :3:" from the end of the Summary field text.

The only documentation Jira links me to for regular expressions is this:

https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html

 

Any additional documentation or similar examples would be appreciated - thank you!

Capture.JPG

1 answer

1 accepted

1 vote
Answer accepted
Jim Edgeton July 17, 2020

I managed to figure this out and for anyone with similar needs, here's each step of my new rule (with regex text included to help copy/paste):

 

Regex to get the Story Point numeric value from the Summary text:

{{issue.summary.match("\s:(\d+?):$")}}

 

Regex to get the Summary text without the Story Point " :X:" appended to the end:

{{issue.summary.match("^(.*)\s:\d+?:$")}}

 

Rule_Clip1.JPGRule_Clip2.JPGRule_Clip3.JPGRule_Clip4.JPG

Suggest an answer

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

Atlassian Community Events