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

This widget could not be displayed.

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.

This widget could not be displayed.
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.

This widget could not be displayed.

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.

This widget could not be displayed.

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.

This widget could not be displayed.

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 Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

204 views 1 3
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