Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to trigger a Workflow again on change of a field value ?

Rohan37
Giga Expert

I have two fields 

SLA_values [related List type field]

Approving_Group [Reference type field]

My requirement :  

If I were to change/update the values of either of the above two fields the workflow is to be run again on that record and ask for Approval to  whatever group that has been selected in the Approving_Group field. 

Now, how what Business Rule (I'm assuming BR) do I run to check if the values of the above 2 fields have been updates ? and based on that re-trigger the workflow again  ? 

Thanks. 

 

P.S. I could use some urgent help ... 

 

1 ACCEPTED SOLUTION

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,

I will suggest create a business rule and give condition as Approving group change's and SLA field changes. Also put one more condition i.e. approval is not yet requester or approval is requested. Meaning once the change is approved the business rule should not trigger. Just a suggestion if you want you can remove this condition.

 

Script:

new global.Workflow().restartWorkflow(current);

current.autoSysFields(false);

current.update();

 

Check below scripts:

https://community.servicenow.com/community?id=community_question&sys_id=f5ae7e65db58dbc01dcaf3231f96...

https://community.servicenow.com/community?id=community_question&sys_id=d2f143e9db98dbc01dcaf3231f96...

 

THanks
Ashutosh

View solution in original post

2 REPLIES 2

Apeksha Joshi
Kilo Guru

hi Rohan ,

whenever you create a workflow give their the condition in workflow while creating that whenever the group / SLA value changes then it will run everytime the value changes .

to give approval to specific group , you select approval group activity and in that write a script to get the selected group :

var grp = current.variables.Approving_Group;

return grp;

this will send approval to the selected group.

 

If my reply helps you at all, I’d really appreciate it if you click the Helpful button and if my reply is the answer you were looking for, it would be awesome if you could click both the Helpful and Accepted Solution buttons!

 

Regards,

Apeksha

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,

I will suggest create a business rule and give condition as Approving group change's and SLA field changes. Also put one more condition i.e. approval is not yet requester or approval is requested. Meaning once the change is approved the business rule should not trigger. Just a suggestion if you want you can remove this condition.

 

Script:

new global.Workflow().restartWorkflow(current);

current.autoSysFields(false);

current.update();

 

Check below scripts:

https://community.servicenow.com/community?id=community_question&sys_id=f5ae7e65db58dbc01dcaf3231f96...

https://community.servicenow.com/community?id=community_question&sys_id=d2f143e9db98dbc01dcaf3231f96...

 

THanks
Ashutosh