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.