Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Populate Assignee System Field Based on the value of Single Group Picker Custom Field

Alvin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 9, 2018

Hello Community, How can I populate users on Assignee field based on the value of custom single group picker field?

Scenario is tickets are unassigned by default, when the agent tries to edit the issue, Assignee should contain only the users (values) on the single group picker custom field

Example is:

Assignee : Unassigned

Single Group Picker : ABC TEAM

Values on Assignee must be ABC TEAM users. 

Can behavior do this? or post functions? any help is really appreciated. if you have sample code to start with, that would be great. Thank you

1 answer

0 votes
Krisztian Kovacs
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2018

Hi @Alvin,

What I've done in the past was setting up a custom field where users were collected from a group and the copied the username from that field to the assignee (also removed assignee from fields).

Does that make sense?

I wonder if that approach would help you. Let me know what you think.

Cheers,
Krisz

Alvin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2018

Hi @Krisztian Kovacs, I foresee what have you done and I think that really made sense. did you still have the sample code? and where it had been used? behavior ? post functions? thank you

Krisztian Kovacs
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2018

Hi @Alvin,

unfortunately it was very specific for a client, but here is the gist of it:

  1. remove assignee from appropriate screens
  2. create single select customfield
    1. have scriptrunner collect users in group
    2. this could be a manual though if your users don't change
  3. use a post function to update the assignee field using the username stored in the single select field

I think I had to go really fancy and use "George Smith - g.smith@company.com" format in the single select field, so I ended up parsing that and used the email address to look up the user object and then put that in the assignee field.

Does that make sense at all?

Cheers,
Krisz

Alvin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2018

Hi @Krisztian KovacsOhh I see. I got the point but what do you mean by appropriate screens? because on the #3 how can I update assignee if it is removed from the screens. Thank you

Krisztian Kovacs
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 11, 2018

The script will do it for you, based on what user is in the field. The idea is to completely replace the assignee field with your own.

Alvin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 11, 2018

Hi @Krisztian Kovacs 

I need the assignee user picker to be populated everytime the group change. is it possible on post function? or should I use listener? or behavior?

Krisztian Kovacs
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 11, 2018

It depends on when you change the group. If it's on the edit screen then behaviour, if it changes somewhere else, you could use a listener. 

I'd expect users to change the field on the edit and create screens, so I'd use a behaviour to update the assignee field. 

Alvin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 11, 2018

Hi @Krisztian Kovacs , but post functions and behavior have different syntax right? 

Suggest an answer

Log in or Sign up to answer