Catalog item Workflow issues. RITM gets closed automatically when the form is submitted.

Vaishnavi35
Tera Guru

Hi ,

 

I have a workflow created.

The RITM state automatically gets closed.

There are two catalog tasks getting created when a specific condition is selected. Even the tasks are getting opened in Closed Incomplete state.

Vaishnavi35_0-1692881224028.png

 

Wait for condition code, if its correct?

// Set the variable 'answer' to true or false to indicate if the condition has been met or not.
var gr = new GlideRecord("sc_task");
gr.addQuery("request_item", current.sys_id );
gr.addQuery("active", true);
gr.query();
if (gr.hasNext()) {
answer = false;
}
else{
answer = true;
}

 

Please help?

 

Thanks,

Vaishnavi

3 REPLIES 3

Michael Jones -
Giga Sage

When you use "show workflow" on one of the items, does it look like it is moving through your wait condition?

It doesn't look like there is anything wrong with your wait condition, but I'm curious why you are using one to begin with? Normally I'd say just make sure each task has Wait for Completion checked and use a join where you have the wait - the join won't move forward until all of the active paths have reached it. 

It also looks like you have "create new my learning" going down the path that auto closes the request so that may be part of your issue. 

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

Nayan  Dhamane
Kilo Sage
Kilo Sage

Hello @Vaishnavi35 ,

Please share screen shot of your runned workflow through 'show workflow' I can check exact issue.

Instaed of wait for condition activity use join activity it will wait to proceed further until both the branches reaches it.

 

If my answer solved your issue, please mark my answer as Correct & Helpful based on the Impact

Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.

Mohith Devatte
Tera Sage
Tera Sage

Hello @Vaishnavi35 ,

try this 

in your catalog task activity just check this check box to true "wait for completion" . 

Screenshot 2023-08-24 at 21.46.11.png

And remove the wait for condition and connect the line to set values directly 

 

Hope this helps 

Mark the answer correct if this helps you 

Thanks