JWM Automation Help

Yasmine
Contributor
March 8, 2023

Hi Everyone, 

I'm trying to set an automation for the following scenario and i'm struggling with once piece. 

Automation: When issue is created, and issue type is X, and field A is one of D, E, F, then create sub-task. 

What i need is for the subtask summary to copy the entry selected in field X on the parent issue. How do i do that?

2 answers

1 accepted

1 vote
Answer accepted
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 8, 2023

Hi Yasmine,

If the parent is the one created before you create the sub-task, then in the Summary field of the Sub-task put {{triggerIssue.Field X}} where Field X is the EXACT name of the guild you are copying from.

Yasmine
Contributor
March 8, 2023

Hi John, 

I set up the automation as follows: 

When Value changes for field x, and field x is one of a, b, c then create sub-task and set summary {{triggerIssue.cf[10169]}}. 

The sub-task was successfully created, but the field value did not copy over. What am i missing?

I used this resource to find the field ID

https://community.atlassian.com/t5/Jira-Software-questions/How-do-you-find-a-field-ID-in-a-team-project/qaq-p/1710958

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 8, 2023

The correct syntax is {{triggerIssue.customfield_10169}}

Yasmine
Contributor
March 9, 2023

It worked!! Thank you so much John! 

Like John Funk likes this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 10, 2023

Great! Happy to help. 

0 votes
Hitesh
Contributor
March 8, 2023

Hi Yasmine,

 

To copy the value of a field from the parent issue to the sub-task summary, you can use the following automation rule in Jira:

  • Create a new automation rule with the trigger of "Issue created" and condition of "Issue type is X" and "Field A is one of D, E, F".
  • Add an "Create issue" action for the sub-task.
  • In the "Summary" field of the sub-task, use the smart value {{issue.parent.fields.X}} to copy the value of field X from the parent issue.


This will create a sub-task whenever an issue is created with issue type X and field A is one of D, E, F. The summary of the sub-task will be set to the value of field X on the parent issue.

 

Hope this helps.

 

Regards,

Hitesh.

Yasmine
Contributor
March 8, 2023

Hi Hitesh, 

I set up the automation as follows: 

When Value changes for field x, and field x is one of a, b, c then create sub-task and set summary {{issue.parent.fields.cf[10169]}}

The sub-task was successfully created, but the field value did not copy over. What am i missing?

I used this resource to find the field ID

https://community.atlassian.com/t5/Jira-Software-questions/How-do-you-find-a-field-ID-in-a-team-project/qaq-p/1710958

Hitesh
Contributor
March 8, 2023

It's possible that the issue object that is being used to create the sub-task does not have the custom field value in its memory. In this case, you may need to explicitly request the value of the custom field from the parent issue before setting it as the summary of the sub-task.

Here is an example of how you could modify your automation rule to include this step:

When Value changes for field x, and field x is one of a, b, c then:

  • Retrieve the value of the custom field from the parent issue: {{issue.parent.fields.customfield_10169}}
  • Create sub-task and set summary to the retrieved value: {{issue.parent.fields.customfield_10169}}

Replace "customfield_10169" with the actual ID of your custom field, which you can confirm using the resource you mentioned in your question.

This should ensure that the custom field value is copied over to the summary field of the sub-task when the specified field changes in the parent issue.

 

Let me know if this helps.

Yasmine
Contributor
March 8, 2023

I don't see "Retrieve the value" as an option under actions to perform

Hitesh
Contributor
March 8, 2023

I apologize for the confusion. "Retrieve the value" is not a specific action in Jira automation, but rather a step that you can include in your automation rule to ensure that the custom field value is available when creating the sub-task.

Here is an updated example of how you could modify your automation rule to include this step:

When Value changes for field x, and field x is one of a, b, c then:

  • Retrieve the parent issue object: {{issue.parent}}
  • Retrieve the value of the custom field from the parent issue: {{issue.parent.fields.customfield_10169}}
  • Create sub-task and set summary to the retrieved value: {{issue.parent.fields.customfield_10169}}

Replace "customfield_10169" with the actual ID of your custom field, which you can confirm using the resource you mentioned in your question.

In this updated example, we first retrieve the parent issue object using the {{issue.parent}} syntax. This will give us access to all the fields and values of the parent issue, including the custom field value that we need to copy over.

Next, we retrieve the value of the custom field from the parent issue using the {{issue.parent.fields.customfield_10169}} syntax. This will ensure that the custom field value is available when creating the sub-task.

Finally, you create the sub-task and set the summary to the retrieved custom field value.

I hope this helps!

Suggest an answer

Log in or Sign up to answer