You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi there,
I'd like to update a checkbox custom field via automation in a parent issue like this:
The Checkbox custom field in the parent contains 4 options:
When Subtask A is resolved --> then the Checkbox field in the parent should select the Value "Approval A is set"
When Subtask C is resolved --> then the Checkobx field in the parent should select the value "Approval C is set" (additionally to "Approval A is set")
... same goes for Subtask B.
With the standard in Automation I can only always replace the values that are already selected in the Checkbox.
But what I need: all Approvals A, B, C should be set before the parent issue can move on in the Workflow (so each subtask approval should add a value in the checkbox field).
This is why I tried to use JSON... and this is where I am completely lost. How can I update the field value so that any approval given is selected addionally to approvals that were already given?
I tried this via JSON for "Edit issue fields", but it is not working:
{
"update": {
"customfield_14809" : [{ "value" : "Approval B is set"}]
},
}
What did I do wrong?
Thanks!
Hi @Rebecca - this was a fun one - it this took a bit of trial and error.
Since a multi-select field is kind of like Link or Request participants fields in that they can hold multiple objects, I followed those examples from Advanced field editing using JSON and came up with this, which seemed to work:
{
"update": {
"Multi Select": [{ "add": {"value": "Approval A is set"}}]
}
}
(Where "Multi Select" is the name of my field. You don't have to use field ids, and for clarity in my rules, I prefer to use field names. This is only a problem if you later rename a field. I try to avoid that.)
Hi Darryl,
I'm glad you enjoyed the challenge! :) Thanks so much for you help!
I just implemented and tested it in our Software projectr and it works exactly as we needed it to.
Best regards
Rebecca
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome to hear that it worked! I wonder if you might be willing to share a screenshot of the final rule because I was curious about how you would be identifying each subtask to check if it was closed.
Do you have a corresponding rule that automatically creates subtasks A-D and names then accordingly in their Summary?
So then do you trigger for when any Subtask is closed and then do four "ifs" to check if it is A-D and then tick the appropriate checkbox?
Because I bet I could get that down to one checkbox by using the match function. :-}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Darryl,
this is what the final rule looks like:
...and so on.
And Yes, I do have a corresponding rule that automatically creates and names subtasks A-C while editing of the subtasks is not possible. Depending on the status the Subtask is transitioned to (approved/denied), the corresponding approval in the parent is set.
I never heard of the match function, how does it work? :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually, you might not need the match function at all.
So this assumes that the Summary of your Subtasks is exactly the same text of what the checkbox option.
So for example, one of your checkbox options is:
"Rezeptprüfung und Gegenzeichnung (Produktentwickler) ist freigegeben" (thank you Google Translate?)
Then you could probably do something like this:
* IF subtask is Approved
* Then Edit issue fields Advanced
{
"update": {
"Checkboxes": [{ "add": {"value": "{{issue.summary.concat(" ist freigegeben")}}" }}]
}
}
You'd only need the text functions like match() function or replaceAll() if your checkbox options only contain part of the Summary. Like lets say your checkbox was only included who approved a subtask. So: "produktentwickler genehmigt". Then you'd use this for the value:
"{{triggerIssue.summary.match(".*\((.*)\)").concat(" genehmigt")}}"
You might use replaceAll() if your checkboxes didn't contain the approver, so you could remove it like so:
"{{triggerIssue.summary.replaceAll(" \((.*)\)","").concat(" ist freigegeben")}}"
The advantage here is that you would only need ONE IF block.
I tested that first example above and here's what it looked like:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.