Assigned Catalog task to assignment group user forcefully after few days

surajsukuma
Tera Contributor

Currently, our catalog tasks are automatically assigned to an assignment group in the workflow, and their initial state is "New."

 

I need to add a condition: if a task remains in the "New" state for more than 3 days, it should be automatically reassigned to one of the group members. Additionally, the assignment group owner should be notified.

 

Could you please advise on the best way to implement this?

 

Thanks in advance!

5 REPLIES 5

Runjay Patel
Giga Sage

Hi @surajsukuma ,

 

You can do the following

 

1. In your workflow add "Wait for condition" activity and the condition like

RunjayPatel_0-1729701192244.png

 

and state is "New".

 

2. Add run script activity and get the member of assignment group.

var assignTo ='';
var gr = new GlideRecord('sys_user_grmember');
    gr.addQuery('group','group sys id');
    gr.query();
    if(gr.next()) {
      assignTo = gr.user;
    }

var gr = new GlideRecord('sc_task');
    gr.addQuery('sys_id', 'sc task sys id');
    gr.query();
    if(gr.next()) {
      gr.assigned_to= assignTo;
      gr.update();
    }

 3. cerate a simple notification to send email to assignment group manager. "assigned to changes" add in when to send condition.

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.

Regards
Runjay Patel - ServiceNow Solution Architect
LinkedIn: https://www.linkedin.com/in/runjay
YouTube: https://www.youtube.com/@RunjayP

-------------------------------------------------------------------------

 

Thanks, let me try this

Where should I place the Wait condition and Run Script? after task. 

surajsukuma_0-1730898086410.png

 

Ankur Bawiskar
Tera Patron
Tera Patron

@surajsukuma 

I will suggest to use Flow designer for this with low-code, no-code

Something like this

AnkurBawiskar_0-1730899226618.png

 

Something like this

flow wait.gif

If my response helped please mark it correct and close the thread so that it benefits future readers.

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