Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,816
Community Members
 
Community Events
176
Community Groups

Sub-task naming conventions

Hi,

We are trying to create a change management project and one of the requirements we have is that if an issue type is created that the sub task must have the prefix for the main issue, followed by a unique number 

So for example the issue number is CM-13 and then each sub task created within the issue is as follows  

CM-13-1

CM-13-2

CM-13-3

I found some older posts about this from a few years ago and one was for server. 

 

So my question is, is this possible in server cloud and if so, how can it be done?

Any help would be greatly appreciated.

 

Thanks, Peter

1 answer

0 votes
Mark Segall Community Leader Jan 04, 2023

Hi @Peter Grainger - You could try something like this with automation:

  • TRIGGER: Issue Created
  • CONDITION: Issue Type = Sub-Task
  • ACTION: Lookup Issues
    • Parent = {{issue.parent}}
  • ACTION: Edit Issue (Summary)
    • {{issue.parent}}-{{lookupIssues.size}}

Hi @Mark Segall , Thanks for the reply. What is the result of creating the above mentioned automation? When I try to create the 2nd action it does not give me the option to enter the JQL query, only a description for the issue, am I missing something? Thanks, Peter

 

auto 2.JPGauto 1.JPG

Mark Segall Community Leader Jan 10, 2023

That's not a query.  These are smart values which are known variables that you can provide Jira.  

{{issue.parent}}-{{lookupIssues.size}}

Breaking this down:

  • {{issue.parent}}: the key of the parent issue
  • -: The desired dash between the parent issue key and desired UID of the sub-task
  • {{lookupIssues.size}}: the total number of subtasks returned after the sub-task is created. 

Putting it all together, let's say that you've created your first sub-task on issue key CM-13

  1. Rule fires upon issue creation
  2. Validates that the newly created issue is a sub-task
  3. Queries a list of all sub-tasks for CM-13 (as the first sub-task, there would be only 1 result returned)
  4. Edits the summary to be CM-13-1

The second would make CM-13-2 and so on.

Hope this helps

Suggest an answer

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

Atlassian Community Events