Editing Multigroup picker Jira smart values - Not working
Asked by panjo:

I'm following this solution, I am doing exactly as suggested -

<https://confluence.atlassian.com/jirakb/how-to-add-values-to-a-group-picker-field-using-automation-for-jira-1384127113.html>

However, I get the following error:

(Operation value must be an array of group objects (customfield_xxxxx))

Any ideas?

Thank you in advance


Answers:
author: Julien Rey
body: Hi everyone,

The original KB article mentioned in this discussion was incorrect and incomplete, so I archived it and wrote a new KB article describing various ways to write a rule meant to upgrade a Multi Group Picker field, using either:

* explicit values
* the content of single group picker fields
* the content of multi group picker fields

Can you take a look and let me know if you are facing any issue with the solutions mentioned in this article?

Here is the link to new article: <https://confluence.atlassian.com/automationkb/automation-for-jira-various-methods-to-update-a-group-picker-multiple-groups-field-1416566430.html>

comments: author: Tim Kopperud
body: Thanks [@Julien Rey](/t5/user/viewprofilepage/user-id/1133380), for updating the incorrect article so swiftly.

TimK


author: Julien Rey
body: Hi [@Tim Kopperud](/t5/user/viewprofilepage/user-id/492874)

You are very welcome.

By the way, I realized after writing this KB article, that some of the solutions (using a JSON expression) described at the end of the article will not work if one of the source multi group field is empty.

Since I was not able to figure out a JSON expression that will address the situations where one of the multi group field is empty, I added a warning next to these solutions (saying **Only works if both multi group picker fields 1 and 2 are not empty**), so please be aware.


author: Bill Sheboy
body: Hi [@Julien Rey](/t5/user/viewprofilepage/user-id/1133380)

What are your plans to update your KB article to handle the possibility of empty field values for the additions / removals with the dynamic JSON, beyond the disclaimer added at the end of the article?

If the article cannot describe those changes, please consider removing that suggested solution to potential user errors.

Kind regard,  
Bill


author: Julien Rey
body: [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313)

You're right. I think it's best to just remove the solutions that don't work in the case where one of the source multi group field is empty, to avoid any potential errors.

I just updated the KB article by removing the solutions that don't work in this case.

Thanks for your suggestion.

Cheers

Julien


author: Tim Kopperud
body: Hi [@panjo](/t5/user/viewprofilepage/user-id/3221521), welcome to Atlassian Community.

You might try to replace **set** with **add**, something like this:

    {"update": {"customfield_16209": [{ "add": { "name":"JG-Risk.Amsterdam" } }]}}

TimK

comments: author: Tim Kopperud
body: I was able to reproduce the same error using **set** , and then got the rule to work replacing it with **add**.

I did not test using . (dot) in the group name though (ref comment from [@Marc - Devoteam](/t5/user/viewprofilepage/user-id/3796976) below).

TimK


author: Tim Kopperud
body: Hi [@panjo](/t5/user/viewprofilepage/user-id/3221521) , where you able to get this to work?

This worked for me:

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/338113iCFEF6223CB283ED2/image-size/large?v=v2&px=999 "image.png")

TimK


author: Tim Kopperud
body: Hi [@panjo](/t5/user/viewprofilepage/user-id/3221521), I now also tested using . (dot) in the group name, and it still works fine.

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/338114iA021AD11C5F36FC4/image-size/large?v=v2&px=999 "image.png")

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/338115iF9AB1D77C939D1AF/image-size/large?v=v2&px=999 "image.png")

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/338116i03B50B604BC60B9D/image-size/large?v=v2&px=999 "image.png")

TimK


author: Tim Kopperud
body: [@panjo](/t5/user/viewprofilepage/user-id/3221521), according to the updated documentation replacing **set** with **add**, as in my suggestion above is a correct approach, ref:

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/339058i7B5B18BE5BFFEA78/image-size/large?v=v2&px=999 "image.png")

If you find my answer valuable, it would be helpfull if you mark it as accepted.

**Solution 1** in the article is in my opinion a better approach if you don't need to dynamically use other smartvalues and/or smartvalue logic to add to the field.

TimK


author: Marc - Devoteam
body: Hi [@panjo](/t5/user/viewprofilepage/user-id/3221521)

Welcome to the community.

Can you show your automation and the details of the rule?

This will greatly help members on the community, to help you out.

comments: author: panjo
body: Thanks for reaching out

Here's a screenshot. Thank you

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/336712i5DF4FD8E093DE51E/image-size/large?v=v2&px=999 "image.png")


author: Marc - Devoteam
body: Hi [@panjo](/t5/user/viewprofilepage/user-id/3221521)

Is this custom field of the type group picker and are you sure the group nae is correct.

To my knowledge group names can't contain dots.


Tags: data-center

jira-data-center

jira-software