Clearing a field after it is used to conditionally create subtasks via Groovy's "Create a Subtask"

Hello. I'm developing a workflow and have hit a roadblock. The idea is to create a number of subtasks (1-7) based on a user's selections in a multi-checkbox custom field that appears on the transition screen. I'm successfully creating these subtasks using a conditional.

The subtasks are created multiple times: the transition points from "In Progress" to "In Progress" and the creation loop is iterated with varying sets of subtasks until all 7 are perfect on the same loop - basically it's a QA process.

The end user has requested that the check box clears each time, so they don't have to unselect the previous choices before selecting the new ones. By idea for this was to clear the field after creating the subtasks. I've tried putting the Clear Field Value post function at the end of the list, but that does nothing. Any ideas would be appreciated.

Adam


5 answers

1 accepted

I got this working! Thanks for the help. The problem turned out to be I had the clear function pointing at the wrong field. Dumb mistake that was too obvious to notice at first. Here's what ended up working:

1st position: system default post functions (comment, transition, store, etc)

2nd position: subtask creation using script runner

3rd position: Clear Custom Field post function set to the multi-checkbox field.

Done in this order the subtasks create, the field clears and then checkboxes are clear for the next transition. When I placed the Clear post function earlier the boxes would clear but the subtasks would not be created as the condition wasn't true: the required values weren't set in the field anymore.

Thanks again for the help.

Try to use update custom field instead of clear and leave value box empty. As for my experience clear field dysfunction is little bit buggy

Thanks for the idea!

I gave this a shot and it doesn't seem to fire correctly. Even if I run the Update Custom Field post function very first, all the selected boxes still fire subtasks and remain checked at the next transition. Do you have any ideas about where it needs to be places relative to the system post functions?

I put that postfunction in 2nd place on update transition and on the 1st on create. Please try to put the creation of subissues before that postfunction.

I tried moving the post functions before, but no luck. I'll run this by the developer on my team when he get's back to the office Tuesday. Thank you for the help, it's much appreciated. I think if we can get the issue to reindex between the post functions this should work.

Footnote: The field is definitely clearing with that post function. If I change the order I can prevent some or all of the subtasks from conditionally being created. Yet, when I open the transition screen again all the same boxes remain checked.

Clearing the boxes is my end goal.

I tried moving the post functions before, but no luck. I'll run this by the developer on my team when he get's back to the office Tuesday. Thank you for the help, it's much appreciated. I think if we can get the issue to reindex between the post functions this should work.

0 votes

Are you using script runner to create the subtasks?

I would put the "clear function" before the "store" function, then the "create subtask" function(s) last.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,739 views 11 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot