Forums

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

Jira automation for creating sub-tasks not picking up the smart-values from parent's summary

Jagz September 20, 2021

I am using basic Jira automation to create 2 sub-tasks if the trigger issue satisfies certain conditions.

The trigger issue summary will always start with "Master: " and the sub-tasks summary must be "Android: <remainder of the parent's summary after Master: >" and "iOS: <remainder of the parent's summary after Master: >" respectively.

I have tried  

iOS:{{issue.parent.summary.substringAfter("Master:")}}

 after going through some community posts but this results into 

iOS:

Can someone help me out with what am I missing here?

 

 

Screenshot 2021-09-20 at 11.14.17 PM.png

2 answers

1 accepted

2 votes
Answer accepted
Bill Sheboy
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 20, 2021

Hi @Jagz -- Welcome to the Atlassian Community!

Please try to use the {{triggerIssue}} and drop the parent part to use the information from that issue.  For example:

iOS: {{triggerIssue.summary.substringAfter("Master:").trim()}}

Note I added a trim() function to handle when the trigger issue optionally has a space after "Master:"

If that does not help, please post an image of your entire rule and of the audit log for an rule execution which does not work as you expect.  Thanks!

Kind regards,
Bill

Jagz September 21, 2021

It worked and thanks for the trim() bit :)

Like Bill Sheboy likes this
AKBAR
Contributor
November 17, 2021

Hello @Bill Sheboy ,

Please suggest me the exact value I shall use in the 'Summary' field, where my requirement is as follows. 

Sub-Task's summary = {{ Parent summary + value of Custom field + Value of 2nd Custom field }}  Those 2 values of custom fields will be present in the Sub-Task that is created now. 

Please check the below attached snippet for your reference. 

Thanks in advance Bill... :) 

ATP Error.JPG

AKBAR
Contributor
November 17, 2021

@Bill Sheboy 

My alternative way is :

I Created a branch after Sub-Task create component, typed the summary with the values like " Value of CF1- Value of CF2 - {{issue.parent.summary}} '' and it worked for me but I want to know whether it was fine or I can achieve it in any other ways? 

atp 2.JPG

Bill Sheboy
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.
November 17, 2021

Hi @AKBAR 

I note two things:

  • If your rule works, great!  No need for further changes.
  • Otherwise...
    • Can your story have multiple sub-tasks, as I note your branch is iterating over all sub-tasks of the story?
    • If you only want to update the most recently added sub-task, please change your branch to "most recently created issue".

Kind regards,
Bill

Bill Sheboy
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.
November 17, 2021

@AKBAR you seem to have posted these two comments in both threads.  Please look at my response in the other one: https://community.atlassian.com/t5/Jira-Software-questions/Jira-automation-for-creating-sub-tasks-not-picking-up-the-smart/qaq-p/1810344

AKBAR
Contributor
November 17, 2021

@Bill Sheboy 

I need to automate the creation of 10 sub-tasks for each single story, where I need the summary of each sub-tasks must have the concatenation of 3 items as below: 

  1. Parent summary
  2. Custom field X's value what I gave at 'Action -> Create Sub-tasks -> Fields'
  3. Custom field Y's value what I gave at 'Action -> Create Sub-tasks -> Fields'

The Values of the custom fields will differ from one sub-task to another. 

I have setup the 'Create sub-tasks' Action with the values set for Custom fields X & Y. 

For each sub-task creation I need different values of X & Y Custom fields. 

With the Branch rule I can only get the parent summary by using Edit Fields Action.

Please share with me the Json smart value to be used in the 'Edit fields'  Action for the Sub-tasks' summary with the above mentioned '3' concatenation points. 

Note: The Custom fields X & Y are used for Sub-Tasks alone but not used for 'Story'

Bill Sheboy
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.
November 18, 2021

When editing an issue in an automation rule, the location in the rule (scope) is what decides which issue is edited.  There is no way to directly edit the sub-tasks of an issue, with JSON advanced edit or otherwise.

Instead, you use a branch on sub-tasks or JQL to access them.  Then they may be edited.

Of note: if your custom field X and Y values are changing for each sub-task, you may need to do these sequentially, one after another, in the rule.  The only exception would be if these values are somehow calculated from other fields.

AKBAR
Contributor
November 18, 2021

@Bill Sheboy 

Hey Good day and thanks for your response Bill.

My Branch rules are working well but just trying for some compression of the rule that's it. 

Please tell me how to get the value of a custom field already there for a particular issue and paste the same into the Summary...

Help me with the syntax... please.. I have tried the following syntax. 

"{{issue.parent.summary}} - {{triggerIssue.fields.Custom Field X}}"

Correct me with this Bill..

Bill Sheboy
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.
November 19, 2021

Usually you may just provide the custom field's name, such as: {{issue.My Custom Field}}

When there are special characters in the name, you may need to use the custom field's ID value instead.

If you have doubts if your field is available or not, please find an example issue with data in the field, and then use this how-to article to confirm the smart value needed:

https://support.atlassian.com/jira-software-cloud/docs/find-the-smart-value-for-a-field/

Like AKBAR likes this
0 votes
Jagz September 21, 2021

It worked and thanks for the trim() bit :)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events