Auto update of state from Pending to Inprogress when user inputs are given
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2022 10:53 PM
Auto update of state from Pending to Inprogress when user inputs are given
As a user,
I would like my request state to change from 'Pending' with reason 'awaiting caller' to 'Inprogress' when I add a comment
so that fulfiller can continue to work on request there after
I got this question and I created script as below.
gs.include('validators');
if (current.getTableName() == "sc_task") {
current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
current.state = 2;
if (gs.hasRole("itil")) {
if (email.body.assign != undefined)
current.assigned_to = email.body.assign;
if (email.body.priority != undefined && isNumeric(email.body.priority))
current.priority = email.body.priority;
}
current.update();
}
please help me with the solutions.
- Labels:
-
Change Management
-
Request Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2022 02:48 AM
Hi Gayathri,
Yes, you will have to write inbound action.
In email inbound, when to run condition you can write something like subject contains and body contains as shown below, this subject or body value should be unique value from your above shown email with which you can make sure that you are not executing this for other email.
In action tab you can write script something like below to change state,
I have written above on incident table, looks like you want it on requested item table so change accordingly.
Please mark this as Correct or Helpful if it helps.
Thanks and Regards,
Abhijit
Regards,
Abhijit
ServiceNow MVP