Forums

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

Story Summary with incremental numbers

Valdrin Marmullakaj December 12, 2023

Hi all,

first of - I'm sorry if there is a similar thread which has the solution for my problem. I gave my best browsing, but I wasn't quite successful.

I want to set up an automation which creates two story tickets upon a sprint started. All tickets should be named "Produce Episode " and then followed by an incrementing number each time a new story is created.
So it would look like this:

automation.PNG

 


Sprint 1:
Produce Episode 1
Produce Episode 2

Sprint 2:
Produce Episode 3
Produce Episode 4

etc...

Up until now my automation looks as follows:
1. When Sprint created (for testing reasons I can create a sprint whenever I want; I'll change it to "Start Sprint" later)

2. lookup issues
project = "MISLA" AND summary ~ "Produce Episode" ORDER BY summary DESC

lookup issues.PNG

3. create variable
variable name: varProduceEpisode
smart value: {{lookupIssues.first.summary.substringAfterLast("Episode").asNumber.plus(1).Increment}}

create variable.PNG

4. Create Story
Summary: Produce Episode {{varProduceEpisode}}
story.PNG

Unfortunately, my automation doesn't work correctly and there are no numbers displayed in the summary. Can someone give me a hint in the right direction?

Also: if I want to create automatic subtasks for those two stories, can I just use the "Then" create subtasks?

Thank you in advance!

Valdrin

2 answers

0 votes
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.
December 12, 2023

Hi @Valdrin Marmullakaj 

The JQL for your Lookup Issues action is intended to return any prior issues using your Summary format / naming convention:

project = "MISLA" AND summary ~ "Produce Episode" ORDER BY summary DESC

That will return any issues which contain both the words "produce" and "episode", regardless of location in the summary.  Do any other issues contain those words?  If so, you may be matching something unexpected, leading the starting count of 1 each time.

 

To find the exact phrase of "Produce Episode" that needs to use this syntax:

project = "MISLA" AND summary ~ "\"Produce Episode\"" ORDER BY summary DESC

Please look here to learn more about the fuzzy search and CONTAINS ~ operator: https://support.atlassian.com/jira-software-cloud/docs/jql-operators/#CONTAINS----

 

Kind regards,
Bill

0 votes
Adrien Low _ServiceRocket_
Community Champion
December 12, 2023

Hello @Valdrin Marmullakaj ,

It seems that the issue is with your Create variable action.

Can you please try replacing the value with the below?

  • {{lookupIssues.first.summary.subStringAfterLast(" ").asNumber.plus(1)}}

In your value, substringAfterLast("Episode") is returning the space after the word "Episode" instead of the number.

A good tip is to always try to print your variable using the Add value to the audit log action to verify if your variable is indeed returning the expected value:-

Screenshot 2023-12-12 214656.pngScreenshot 2023-12-12 214722.png

Please give it a try and let us know if it helps.

Also: if I want to create automatic subtasks for those two stories, can I just use the "Then" create subtasks?

Yes, this should be doable.

Regards.

Valdrin Marmullakaj December 12, 2023

Hi @Adrien Low _ServiceRocket_ ,

thanks for your comment and the tip with the log action!

Unfortunately it doesn't work quite well for me, I've adapted your value above, however the ticket summary is always "Produce Episode 1". I've tested it three times, normally the summary for the latest ticket should be "Produce Episode 6".
Log action also shows always 1.

log action.PNG

Any idea if I'm missing something?

Adrien Low _ServiceRocket_
Community Champion
December 12, 2023

Hello @Valdrin Marmullakaj ,

Can you share your automation configurations for our review?

Regards.

Valdrin Marmullakaj December 12, 2023

Hi @Adrien Low _ServiceRocket_ 

of course, I hope the screenshots can provide more information:

automation overview.PNGlookup.PNG

creation variable.PNG

log action config.PNG

story creation.PNG

 

Thank you!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events