Forums

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

Create Subtasks when a custom field value changes

Pushpkant Garg
Contributor
December 11, 2019

I have a custom field which is of type Checkbox. This custom field is being updated at multiple stages. Whenever this field values are updated ONLY added values related sub-tasks should be created. 

 

For example, I have a workflow having statuses Open, In Progress, Development, Testing, Closed

Whenever issue transitions from Open to In Progress or In Progress to Development and so on, Department Customfield gets updated (new values will be checked on every transition). 

A relevant Sub-Task(s) should be created Only for those newly added values.

3 answers

1 accepted

1 vote
Answer accepted
Pushpkant Garg
Contributor
December 15, 2019

The solution to this problem: 

1. Configure the Trigger (in my case field value changed or Issue Transition)
2. New Condition: if/else block
3. Set condition:
First value: {{changelog.Sub-department.fromString.contains("Beta")}}|{{changelog.Sub-department.toString.contains("Beta")}}
Condition: Equals
Second value: false|true
4. Action: Create Sub-tasks

Please contact the Automation team, if you guys more clarification. They are simply awesome :)

0 votes
Yvan Martin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 12, 2019

Hi Pushpkant,

Developer from Automation here.

We have the individual actions/conditions to do most of what you want, but if you intend on using a multi checkbox then unfortunately we can't yet iterate/loop over the values to be able to create individual sub-tasks for each added item. 

Here is a link to our public improvement backlog to iterate over smart value fields here: https://codebarrel.atlassian.net/browse/AUT-81 (You may need to open this in an incognito window, or log out of Jira Service Desk).


Your use-case is possible if you use a single checkbox since then then the field value changed will only contain one value, but that may not align with your requirement if you want to add items as you go along.

Here's an example that should work with a single checkbox:

Screen Shot 2019-12-13 at 3.25.59 pm.png

If you have anymore questions feel free to contact our support here: https://automationforjira.com/contact-us


Cheers,
Yvan

Pushpkant Garg
Contributor
December 15, 2019

Hello @Yvan Martin - It seems there are some updates from the Atlassian side, which now helps us achieving this solution. One of your colleagues helped me in achieving the solution. I have posted the solution in the response to @Elena Swaddipong comment.

Yvan Martin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 15, 2019

Yeah I see now, that should do it. 

I didn't think to use the smart value contains() on the change log.

Anyway nice find, and glad to hear you now have a way to achieve this.

Cheers,
Yvan

0 votes
Elena Swaddipong December 12, 2019

I just did this!

Create an  'Automation' when a field value changes 

Then add a  'If block' with your conditions

Then add new action (Edit Issue) : here you update the Department

 

Hope this helps.

Pushpkant Garg
Contributor
December 15, 2019

Hello Elena,

 

I had already tried this but this doesn't solve my problem. What I want is Subtasks should be created only for the changes/newly added values. 

For community reference, here is the solution. (Note: Automation for Jira guys helped me in achieving this solution)

First value: {{changelog.Sub-department.fromString.contains("Beta")}}|{{changelog.Sub-department.toString.contains("Beta")}}
Condition: Equals
Second value: false|true

 

This solution works absolutely correct.

 

Thanks,

Pushpkant Garg

Elena Swaddipong December 16, 2019

Hi Pushpkant this is what I did and worked for me:

In order to avoid creating  a ticket  repeatedly - i tagged the task and before creating a new one  check whether it existed...  

 

Seems that you are set but just in case.

 

 

 

Jira Automation.PNG

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events