Set active to False

Jeffce
Tera Expert

Is this a business rule? I have changes that are closed incomplete but still show active? Where is this flag set?

 

Thanks JJ

1 ACCEPTED SOLUTION

marcguy
ServiceNow Employee
ServiceNow Employee

very simple example, if phase is closed or withdrawn, then set state to closed:


condition: current.phase_state.changesTo('closed') || current.phase_state.changesTo('withdrawn')


script:



current.active=false;


if (current.phase_state.changesTo('closed'))


{current.state = 3;}


  if (current.phase_state.changesTo('withdrawn'))


  {current.state = 7;}


View solution in original post

11 REPLIES 11

Can i see what your business rule looks like?



JJ


rezacol
Mega Expert

Yes there is a business rule which is OOB and also a scheduler named as Autoclose Changes. This business rule automatically closes the ticket if the ticket is in Resolved status for some particular day without being updated. You can see the business rule in autoclose changes. If current.active=false is not there. Add this line before updating the record.



Thanks,


Reza


I am not understanding what you mean here, I found a business rule called "Auto Close on Approval" But what do I do after tyhat, I see the current.active=false is there.



JJ


Can you paste the whole script in that business rule ?? Does that condition apply for "closed Incomplete" or just applicable to "closed" status?



Thanks,


Reza


marcguy
ServiceNow Employee
ServiceNow Employee

very simple example, if phase is closed or withdrawn, then set state to closed:


condition: current.phase_state.changesTo('closed') || current.phase_state.changesTo('withdrawn')


script:



current.active=false;


if (current.phase_state.changesTo('closed'))


{current.state = 3;}


  if (current.phase_state.changesTo('withdrawn'))


  {current.state = 7;}