How to get parent issue key of a sub-task copied into summary of an automated linked issue

Nikhil September 16, 2019

We have a scenario where we applied 2 automations via postfunctions and need help in defining the summary in a desired format by copying the issue keys to summary.

Here's the detailed description.

 

There is a project in our instance called "COFFEE" with issue types 'Task' and 'Sub-task'.

Task has a checkbox custom field with options Decaf, Mocha and Cappuccino.

Sub-task has a single select custom field with same options Decaf, Mocha and Cappuccino.

Also, There are projects existing for each option in the fields. 

 

Automation 1:

Workflow associated with 'Task' has a transition called "Generate Sub-tasks". Upon hitting the transition, it automatically creates sub-tasks based on the value selected in the checkbox custom field - adds the summary in format: [Value selected: Task summary]

Example of how the functionality works:

Let us consider if I created a 'Task' with summary = "Coffee preparation" and the issue key = COFFEE-1

Upon hitting the transition 'Generate Sub-tasks', I selected 'Decaf' and 'Mocha' as options on checkbox custom field. This creates two sub-tasks as below:

Sub-task #1: 

Issue key: COFFEE-2

Summary: "Decaf: Coffee preparation"

Single select field value = 'Decaf'

Sub-task #2:

Issue Key: COFFEE-3

Summary: "Mocha: Coffee preparation"

Single select field value = 'Mocha'

 

Automation 2:

Create transition on the workflow associated with 'Sub-task' has post functions to create issues in different projects based on the value on single select field.

Defined summary of the post-function as "%original_key%: %original_Summary%" to the summary  which adds the summary in the desired format: [Subtask Key - Subtask Summary]. 

Ex: Upon generation of the sub-task 'Coffee 2', it also automatically creates an issue in the project "DECAF" with a link "Depends On" between sub-task and newly created DECAF issue. Likewise, sub-task "Coffee 3" auto creates an issue in the project "MOCHA" with a link "Depends on/Depended by" between sub-task and newly created MOCHA issue. Details of the auto created issues:

Issue #1:

Project = DECAF

Issue key = DECAF-1

Summary = "COFFEE-2 - Decaf: Coffee preparation"

Linked issues = Depended by 'COFFEE-2'

Issue #2:

Project = MOCHA

Issue key = MOCHA-1

Summary = "COFFEE-3 - Mocha: Coffee preparation"

Linked issues = Depended by 'COFFEE-3'

 

Here's my Requirement:

I'm looking for a way to add issue key of the 'Task' to the beginning of the summary of the issue created in Automation 2. Something in this format: [Task key / Subtask key  - Subtask summary]

Examples:

Summary of Issue #1: COFFEE-1 / COFFEE-2 - Decaf: Coffee preparation 

Summary of Issue #2: COFFEE-1 / COFFEE-3 - Mocha: Coffee preparation

 

I have tried defining [%parent_key% / %original_key%: %original_Summary%] in the summary of the post-function but it returns the same value (sub-task issue key) for both variables '%parent_key%' and '%original_key%' but not the issue key of the parent 'Task' of the sub-task.

I apologize for the long description. Any workaround is highly appreciated. 

1 answer

0 votes
Andrew Laden
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.
September 17, 2019

I think it is a very bad idea to include the issue key of a different issue in the summary of an issue. Particularly if you work in email at all. The email subjects are going to look very confusing, and the mail handlers will probably end up placing replies on the wrong issue. You may want to take a step back and see what it is you are really trying to accomplish

As for the how, a lot depends on what automation you are using to create the subtasks and linked issues, as the specific methodology will change dependent on that. From the example, I guess you are using JSU or Create on transition, but I am not sure. But without that information, its hard to make a suggestion as to how to fix it.

Suggest an answer

Log in or Sign up to answer