Copy a field value from parent to stories and subtasks
I want to copy a field, lets say field A from the epic onto Stories linked to the epic and also the sub-tasks inside the stories.
Example is like I have a field called "PID : 1a1a" on the epic page , I want to see the same value "PID : 1a1a" in the stories linked to the epic and also the same value inside the sub-tasks that are under the stories
Comments (7)
-
repo owner -
reporter If you dont mind could you please help me with both the approaches, ideally what we wanted was when ever we have the field A in epic updated then the same value should be updated in the stories and sub-task but I know that we can only do that through a transition.
Please help me with both the approaches I will figure out which one would be the best for us because we want to try both the approaches and then see what will come close to the requirement.
-
repo owner #Approach 1: Post-function in Epic's workflow #
Add the following 2 post-functions to a transition in parent issue:
1) Post-function "Copy a parsed text to a field" with the following configuration:
Text to be parsed is:
toString(filterByIssueType(linkedIssues("is Epic of"), "Story") UNION subtasks(filterByIssueType(linkedIssues("is Epic of"), "Story")))
I'm considering that by Story you mean all issues with certain Epic and with Story issue type. In case you want to consider all issue types with a certain Epic, i.e., don't limit issue types, you should use the following text to be parsed:
toString(linkedIssues("is Epic of") UNION subtasks(linkedIssues("is Epic of")))
2) Post-function "Write field on issues returned by JQL query" with the following configuration: JQL query is:
issuekey in (%{00061})
Once configured, your transition in Epic's workflow will look like this:
-
repo owner #Approach 2: Post-function in Story and their subtasks #
You should use post-function "Copy a parsed text to a field" in Stories and their substasks workflows with the following configuration:
- Target field: A
- Parsing mode: advanced
- Text to be parsed (in the workflow of Story issues):
first(fieldValue(%{nnnnn}, linkedIssues("has Epic")))
- Text to be parsed (in the workflow of Story's subtasks):
first(fieldValue(%{nnnnn}, linkedIssues("has Epic", %{00041})))
Note that:
- nnnnn should be replaced with field code of A custom field. This code depends of each particular JIRA instance.
- %{00041} is field code of Parent's issue key.
-
reporter I tried both of them and both of the solutions work perfectly well, you are really a great man thanks for the help I will keep you posted if any problem comes up thanks once again.
-
reporter - changed status to resolved
The issue is resolved
-
repo owner Thanks for your words, Bharath.
- Log in to comment
It can be done using a post-function. There are two approaches:
Which approach do you prefer?