Forums

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

Sub-task naming conventions

Peter Grainger
Contributor
January 4, 2023

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 Champion
January 4, 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}}
Peter Grainger
Contributor
January 10, 2023

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 Champion
January 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
Product Admin
TAGS
AUG Leaders

Atlassian Community Events