Auto update state in case

servicenow_devo
Tera Expert

Hi Developers,

 

Just need help in 2 scenarios of in case mangement. Case state needs to be automatically updated to inprogress when case reaches 'on hold until ' date from onhold and case state should automatically change to responded when user responds to case over comment or email. Can this be done via on development method?

Thankyou
4 REPLIES 4

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @servicenow_devo 

 

The first part you can di via Flow Designer or via schedule jobs.

If Flow designer

 

Then Trigger - Repeat

Action#Look up records 

with conditions

For 2nd part

You can use Inbound action or again flow both can be do able here.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Hi @Dr Atul G- LNG 

Thankyouu. Can this be done via BR? Can you elaborate this as I am new to Servicenow 

Thankyou

Yes, but BR will work when when some one open the record , so better use Flow Designer. 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Anand Kumar P
Giga Patron
Giga Patron

Hi @servicenow_devo ,

 

Yes you can write after update business rule on case and check if current date matches the onhold date the update the state to inprogress.

For updating the case state when user respond over email or comment then use inbound email action or flow
typing 'Inbound Action' in the left navigation menu) create new one write script something like below-

if(email.subject.indexOf('On Hold') > -1)

      emailState = true;

var incNum = email.subject

var inc = new GlideRecord('case');

inc.addQuery('number', incNum);

inc.query();

if(inc.next()){                inc.incident_state = 'Pending';

    inc.update();

}
Mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand