I want to set my rule to add the Next unreleased version instead of setting it to the Next unreleased version but I dont know what the field name is called. This is what I'm envisioning:
If I understand your use case, you want to add the Next Unreleased Version to fixVersion in addition to any current values in fixVersion. Is that correct? If so...
Short version: you cannot do that without a work-around
Longer version:
JQL knows about Next Unreleased Version for queries, and rules know about that value for field edits, but the issue fields know nothing about other versions/releases: only their current values.
One work-around would be:
Kind regard,
Bill
Thank you @Bill Sheboy for the workaround! Your steps worked perfectly and my fixVersions are now exactly what I needed. Appreciate the help!
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 that helped, Lynne.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I know it's an old post, but how did you add the saved values with the JSON format?
I'm trying things like
{
"update": {
"fixVersions": {{origVersions.name.asJsonObjectArray("name")}}
}
}
which is not correct because it's missing the "add" verb. how can this be done?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Amy Chan
Please take a look at this documentation for examples of add versus update with JSON, and of how to modify the fixVersion field: https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/
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 Sheboy - have done, still not sure. Update has to be used with a list of set/add/remove directives, of which I want add. To add fix versions you seem to have to add them one by one a la
"update": {
"fixVersions": [
{ "add": {"name": "versionName1"}},
{ "add": {"name": "versionName2"}},
{ "add": {"name": "versionName3"}}
]
}
and so on (there is the example for labels showing how to add an array of labels to the set of labels).
But `origVersions.asJsonObjectArray("name")` will produce an array of `{"name": "versionName_i"}`, but now I need to nest it further in an "add".
Using `"fixVersion": {{origVersions.asJsonObjectArray("name").asJsonObjectArray("add")}}` would seem to do what I want, except this just gives me "invalid JSON" with no way to view the generated JSON to see what's gone wrong.
Do you have an example of how precisely to do that last step?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Amy Chan - The only way I could make it work was to save each element in the array separately (screenshot below) and then I use an update similar to the one you have.
It became quite long because this forced me to check the number of fix versions that already exist on the issue first and then I followed @Bill Sheboy 's steps for each if/else block. So i ended up checking 4 cases: no fix version, 1 fix version, 2 fix versions, and 3 fix versions. I figured that would be a maximum number of fix versions for our project.
Hope that helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Lynne Robinson ahh, thanks. Here is what I ended up with (and was hoping to simplify) - may be a little easier than yours. The idea is to save the original version(s), set the fix version to latest unreleased, save that too, change the issue back to the original version(s) and finally append the latest unreleased using the JSON (since this is just a single version).
1. create variable origVersions = issue's fix versions
2. edit the issue to set fixVersion = latest unreleased
3. re-fetch issue data
4. create variable latestUnreleasedVersionName = {{issue.fixVersions.first.name}} (we know it's only one version long) - basically store the name of the 'latest unreleased'
5. edit the issue to set fixVersion back to {{origVersions}} (not using the JSON - just using the normal 'edit issue')
6. use the JSON format to append the latestUnreleasedVersionName back to the versions list
still very verbose but saves the 4 cases and adding one by one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.