Coding help needed - Assignment Group / Assigned To

JennyBell
Tera Contributor

Hello,

 

I am new to ServiceNow with little coding experience.  I have put my query into CoPilot and also looked through community posts, but don't see my specific situation.

 

I have a form called Service Desk Request.  This request form is currently used by ITIL users and will eventually be used NON-ITIL users if there is not a specific Request form already in our catalog.  This form will also be used by non-ITIL users to request something.  A Task is sent created and currently gets assigned to the opened by user, which 99% opened by a Service Desk group member. 

 

**Note, many of our ITIL users are members of multiple user groups and we need to set the specific Assignment Groups on our tasks**

 

The issue is if a non-ITIL user uses this form.  I need code to do the following: 

- If the Request is NOT opened by a member of the Service Desk group assign the 1st task to the Service Desk.

- If the Request IS opened by a member off the Service Desk group, set the assigned to the opened by user and assignment group as Service Desk.

 

Any guidance is GREATLY appreciated. Thanks!

15 REPLIES 15

Shivalika
Mega Sage

Hello @JennyBell 

 

Are you using any flow for this catalog form that creates the task ?

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

Hi there Shivalika,

 

Yes, we have a flow which creates the task currently.  Initial task gets assigned to Service Desk regardless of who opens it - if it is opened by a Service Desk group member, we want the task assigned to the opened by user.  They then assign this task to another group or they fulfill the request.  Once this task is closed a second task is created and needs to be assigned to the Service Desk group and if originally opened by a Service Desk group member, it needs to be assigned to that user.

@JennyBell  Is everything else working fine and only assignment part is breaking right ? Like the tasks creation - is the second task being created only after first is closed? Is the current Assignment working correctly ?

 

Then I will only share script for your assignment, otherwise we may need to evaluate further aspects. 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

Task creation is working fine - 2nd task is generating after 1st task is closed, which is what we want.  Originally, I had the Assigned to = Opened by.  The Assignment group did not populate on the Task, even when I defaulted it in the flow to Service Desk - Service Desk was removed (this wouldn't matter if the opened by ITIL user wasn't a member of multiple groups, but we have reporting based on Assignment group and what work the opened by does under this group.)

 

I am going to try your suggestions above and will respond once I have tested.  Thanks!