The CreatorCon Call for Content is officially open! Get started here.

'Assign To Me' button in Incident and catalog task and population of assignment group

Amith3
Kilo Contributor

Hello All,

I have a requirement to add 'Assign To Me' button/UI Action in Incident and catalog task. But the button should be available to all, regardless of where the ticket is assigned. For example – I get an email \ call \ Skype asking to look at a ticket assigned to SAP team. I then read the details and I can fix it. So I click “Assign to me” button and pick up the call.

In short, whatever the group the ticket is assigned to, if i click on 'Assign To Me', it should get assigned to My Assignment Group and then to me.

Our system is set like an Incident is assigned to one Group automatically based on the 'IT Service/Business Service' user selection in the ticket and then the support person who is a part of that group can assign to his/her name. 

So how to implement the 'Assign To Me' button here? My view is if I click on the 'Assign To Me' button, the ticket should assign to me , if i am part of the group in which the ticket is Assigned. Else if i am not part of that group, a message should come 'You are not part of the group, Please select the correct assignment group' clearing and making the 'Assignment Group' selection field as mandatory (and also it should list the groups which i am part of).

Is that possible? If yes, could you please help with the details/code?

find_real_file.png

17 REPLIES 17

Hi Amith,

To check if user is a member of the group or not, you need to do this at the server end. on the server side, you cannot control the form behavior such as making the field mandatory or clearing it.

For this you need to create a SI and place the given code there then call that in the UI action (enable client checkbox). Based on the result, you can then make the fields clear and mandatory using the below code

g_form.clearValue("assignment_group");

g_form.setMandatory("assignment_group",true);

Kindly mark the comment as helpful if it helps. 

 

Hi,

One more valid scenario is not to show the button itself when logged in user is not member of that group which is present on form

This will avoid unnecessary messages being shown to the users when condition is not satisfied.

Regards
Ankur

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

Hi Ankur,

All the users should be able to see the button irrespective of the groups and assign to their name.

Hi Amith,

I think it makes sense hiding the "Assign to me" button if they are not member of the current assignment group.

If they are not member they would see and when they click they would see the message

That is not a good user experience

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 Amith,

If you go with Ankur suggestion, then you don't need to clear the field or make it mandatory. The code that i have provided will work correctly.

Kindly mark the comment as a correct answer and helpful if it helps to solve your problem.

Regards,
Asif
2020 ServiceNow Community MVP