groovy script for cloud
Asked by Ananthakumaran:

When i am creating a ticket in the jira cloud, in the issue fields section i have added a field named Team approvers and it is a multi select options and in that field when i select any options it should be added in the approvers group after creating the ticket. can anyone solve this issue with necessary script code or any automation rules to get the following result.![Screenshot 2024-02-09 175100.png](/t5/image/serverpage/image-id/305445i972F171B9128B26B/image-size/large?v=v2&px=999 "Screenshot 2024-02-09 175100.png")


Answers:
author: K Vivek Rao
body: Hello [@Ananthakumaran](/t5/user/viewprofilepage/user-id/5398000)

Here is the approach i followed to achieve this requirement, as per the provided details i understand the fields "Team approver" and "Approver Groups" are multi group picker fields.

instead of issue created, use issue value changed trigger.

I created 2 custom fields

Team Approver (source) ID 10144

Approver group (destination) ID 10119

Configured as below

![Screenshot 2024-02-09 at 22.54.12.png](https://community.atlassian.com/t5/image/serverpage/image-id/305504i22A3C5DE45C39CBA/image-size/large?v=v2&px=999 "Screenshot 2024-02-09 at 22.54.12.png")

<br />

![Screenshot 2024-02-09 at 22.56.31.png](https://community.atlassian.com/t5/image/serverpage/image-id/305506iC3BC584E6AA17242/image-size/large?v=v2&px=999 "Screenshot 2024-02-09 at 22.56.31.png")  

This should work.

comments: author: Ananthakumaran
body: Hi, [@K Vivek Rao](/t5/user/viewprofilepage/user-id/3795976) ,

This solution doesn't meet my expectations. when i'm ![Screenshot 2024-02-10 132949.png](https://community.atlassian.com/t5/image/serverpage/image-id/305587i4282A0512DBD14DD/image-size/large?v=v2&px=999 "Screenshot 2024-02-10 132949.png")updating the issue, the values in the team approver fields is showing none. Please find the screenshot for reference.


author: K Vivek Rao
body: Hi [@Ananthakumaran](/t5/user/viewprofilepage/user-id/5398000)

Could you please share the screen shots of your automation configuration.


author: Ananthakumaran
body: ![Screenshot 2024-02-10 143817.png](https://community.atlassian.com/t5/image/serverpage/image-id/305588i804237403E174B69/image-dimensions/408x235?v=v2 "Screenshot 2024-02-10 143817.png")

[@K Vivek Rao](/t5/user/viewprofilepage/user-id/3795976) , Please find the above screenshot for reference


author: K Vivek Rao
body: There is an extra space and gap in your code, could you please check those once and try. compare the code format as per my screen shot and maintain similar pattern

also i hope you are selecting the group names while creating the issue


author: Ananthakumaran
body: Let me check


author: Ananthakumaran
body: It is not working [@K Vivek Rao](/t5/user/viewprofilepage/user-id/3795976)


author: Ananthakumaran
body: Hi [@K Vivek Rao](/t5/user/viewprofilepage/user-id/3795976) i have the same issue now and in team approver i have certain approver(20 approvers) and in the the Approver Groups i have the corresponding Approver groups of 20 team approvers. for example if i have selected security in team approver, it should add Security Approver group to the list and so on. if i select multi team approver the corresponding approver groups should get appended to the list. This is my requirement. can you do something on this or help me with this![Screenshot 2024-03-04 145843.png](https://community.atlassian.com/t5/image/serverpage/image-id/310422i4650683A8744B0BE/image-size/large?v=v2&px=999 "Screenshot 2024-03-04 145843.png")![Screenshot 2024-03-04 145731.png](https://community.atlassian.com/t5/image/serverpage/image-id/310421i2EF40B5D0E1E935D/image-size/large?v=v2&px=999 "Screenshot 2024-03-04 145731.png")


Tags: cloud

jira-service-management

jira-service-management-cloud