Hey!
I have 2x automated rules setup in Jira that will be applied around release processes.
The process is:
When a ticket moves from the status 'In QA' --> 'Dev Complete', the ticket is added to the fix version 'vNext'
The vNext fix version in Jira is used as the 'parking lot' for tickets that are ready to be planned into the next release. During release planning, the team will manually add a new fixversion to each ticket, to specify the release # and date etc.
My rule created to add tickets from 'In QA' --> 'Dev Complete' works fine, and tickets are added to vNext as expected:
Rule 2
I have a second rule where I'd like the fix version 'vNext' to be removed as a fixversion once the ticket moves further down the release process/workflow. This is so the vNext queue doesn't get clogged with tickets that are already in the release process/workflow, and we only see tickets in the vNext fixversion that are ready to be planned into the next release.
However, rule 2 I have setup is clearing ALL fix versions from the ticket upon status change. However, I only want to remove the specific fixversion: vNext
This how rule 2 has been setup:
And the JSON included in this rule is:
{ "name": "Remove Fix Version vNext", "enabled": true, "projectKey": "SFCC", "trigger": { "event": "jira.issue.updated", "conditions": [ { "field": "fixVersion", "operator": "contains", "value": "vNext" } ] }, "actions": [ { "action": "edit", "field": "fixVersion", "operation": "remove", "value": "vNext" } ] }
I admit I asked chatgpt for this JSON as I was struggling!
Please could I get some direction with Rule 2, so I'm retaining the new fixversion manually added, and only removing vNext
Thanks!
Hello @Annie Kearns
The reason the field is getting cleared is because you are trying to update it in two ways in the Edit Action; with JSON in More Options, and by having selected it as a field from the Choose Fields list.
Having selected the field in the above manner and leaving the value portion empty tells Jira to clear the field.
Pull down the Choose Fields list and deselect the Fix Versions field. Then only the JSON will be used to try to change the field.
Note: I have not reviewed the JSON code specifically, but I know the above is at least one problem with your rule.
Hey Trudy!
Thanks for your reply :)
That makes sense also, thank you. I've removed the selected fixversion field and saved the change and done a test, however, vNext is not being removed from the fixversion when I change the ticket status.
The rule is currently setup like the below with just the JSON applying and no field selected at the top.
Maybe it could be the JSON?
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just to confirm, this is what you have in the JSON field?
If so, that is totally wrong.
The reference for advanced editing with JSON can be found here:
https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/
For this specific case I found an example in a response in this post.
Replace all the JSON you have with this:
{
"update": {
"fixVersions": [
{"remove": {"name":"vNext"}}
]
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Adding to Trudy's suggestions, your JSON is incorrect for removing that value from the Fix Versions field.
Please try this, adding a condition before the edit to confirm the value is present:
{
"update": {
"fixVersions": [
{
"remove": { "name": "vNext" }
}
]
}
}
The condition before the edit helps ensure that a person has not already manually removed the value.
As another alternative, you could use smart value, list filtering to extract the other values and set the field to the remainder. (Although, this will unnecessarily edit the field when not needed.)
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill,
Thanks so much that's worked a charm :)
That's what I get for asking chatgpt for JSON ;)
Tested and all working as expected
Thanks again
Annie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome; I am glad to learn Trudy and my suggestions helped!
And...in my opinion, one large challenge using any bot-generated suggestions for Atlassian tooling, questions is missing context.
A bot cannot see your site configuration and is often "guessing the next word" using data from web-crawling and other questionably-acquired sources. Thus it parses "JSON" in our question prompt and uses someone's interpretation of what that indicates. It does not go to the documentation source I provided, check the metadata schema for Atlassian automation use of JSON for your specific issue type, etc.
Even though it takes time and effort, my recommendation is reading and experimentation within your site. :^)
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.