Assigned to me UI ACTION

Ankit Kumar6
Tera Contributor

I have a requirement to create a UI Action (button) on incident  that should assign the current login user to assigned_to field.

Note: assigned to should be a member of assignment group then only it will accept the value. otherwise to create a popup to say you are not a member of this group

1 ACCEPTED SOLUTION

glad it helped,

 

kindly mark my answer as correct and close this thread. so it will appear into solved queue. 

View solution in original post

15 REPLIES 15

I tried your code given above.

is it still not working ? 

can you paste screenshot of your UI Action and script include ?

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Ankit,

I would recommend below approach

1) Show the UI action only when the logged in user is member of assignment group of the record

2) It is not good user experience for users to show them the UI action and then when they click they get to

know they cannot assign the incident to themselves as they are not member

1) Create UI Action which is server side

Name: Assign to Me

Condition: gs.getUser().isMemberOf(current.assignment_group)

Script:

current.assigned_to = gs.getUserID();

current.update();

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar  My requirement is that Assign to Me Button will visible to everyone and if logged in user click on that UI action it will get assign to them and the group to which they are member of. 

can you please help me in this

 

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Ankit,

Did you get a chance to read my comment and implement that considering the approach?

Let me know if that helped or stuck anywhere.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader