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

my closed tasks are re-open by system need to stop this issue

ronaldanand
Tera Contributor

Hi ,

  My closed service catalog tasks it automatically reopened by system and I have attached my workflow screen shot here.

where to check and how to stop this task creation,Please check and help me to resolve this issue....

workflow1.jpg

6 REPLIES 6

Hamza Berouil2
Tera Guru

Hi Anand,



Please provide more info :



Take one these tasks, open the attached workflow (ui action in the bottom), take a screenshot and post it here.



Did you check Business Rules agains this table and any parent table ?


ronaldanand
Tera Contributor

Hi Hamza,



Thanks for Quick reply...



Here I attached all the details please check it and assist me



Workflow history


wfh.jpg



No UI policy in the bottom


no_ui.jpg



Condition : current.state.changesTo(6)||current.state.changesTo(3)||current.state.changesTo(7)||current.state.changesTo(8)



Script :


function onBefore(current, previous) {


    //This function will be automatically called when this rule is processed.


    var t=new GlideRecord('sc_task');


    t.addEncodedQuery('request_item.number='+current.number+'^stateNOT IN3,4,7,8');


    t.query();


    if(t.hasNext()) {


          var msg= gs.getMessage('All active and pending tasks must be closed or skipped '+


          'before request may be resolved');


          gs.addInfoMessage(msg);


          current.state.setError(msg);


          current.setAbortAction(true);


          current.state = previous.state;


    }


}


ronaldanand
Tera Contributor

Work flow is


wf1.png


Hamza Berouil2
Tera Guru

Why there are 4 workflow that run against this Task ?



What are the state labels of 3, 6, 7 and 8 for requested items and 3,4, 5 and 7 for Catalog Tasks ?



What does contain the "IF" (Stage resolved - Are all tasks closed ?)