Cancel task SLA default workflow from business rule:

saddamstarr
Tera Contributor

HI All,

I have a customized business rule from some SLA will get cancelled, But However the cancelled SLA's clock is not stopping, because cancelled SLA's workflow are in stil progress.

So i need to cancel the workflow from my business rule.

Please find the BR rule some code which is not cancelling the SLA workflow:

find_real_file.png

kindly provide your input to how i can change my code to cancel the default sla workflow.

Regards,

Saddam

1 ACCEPTED SOLUTION

Hi Saddam,



In your case current is task_sla record. So please try



var workflow = new Workflow();


workflow.cancel(task_sla_gr);



Also remove the line of code related to task_sla_gr.setWorkflow(false);



Thanks


Please Hit like, Helpful or Correct depending on the impact of the response


View solution in original post

13 REPLIES 13

We dont have any field like stage is cancelled or state is cancelled on contract_sla table where we are defining the start, stop and pause conditions.


So you can add a new field on incident table and use it on your stop condition. The field should be set when you cancel the workflow.



Thanks


Please Hit like, Helpful or Correct depending on the impact of the response


Hi



Thanks for your response,



Yes our SLA is in Incident table and we don't have any state called cancelled in our system.


However the SLA which are cancelled from OOB functionality the cancelled SLA's clock are stopping, (i,e: if we are reducing the P1 incident to P2 then P1 attached SLA's are getting cancelled from the OOB and the clock also is not working for those.)



But in our case   two SLA's are getting attached per incident and while closing the incident based on closure dropdown list we are cancelling One SLA forcibly by business rule.



The SLA which was cancelled by our customized business rule is not stopping the clock.



Kindly suggest.



Thanks in Advance,


Saddam


Hi @saddamstarr I'm also facing the same issue. May I know what solution did u use to solve this problem?thank you !