change the incident state from resolved to in progress if the user submitted the survey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-12-2023 09:03 AM
i have a requirement that if the user answered the question ( have your issue been resolved ? ) with no it should make the incident go from the resolved state to in-progress state , can anyone help me with this and if here is a solution with no scripting included that would be much better thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-12-2023 09:14 AM
Hi @mohammed-ahmad ,
Hope you are doing well.
I am not sure if this can be implemented without scripting.
But with after business rule you can definitely achieve the required outcome
Write a after BR on asmt_assessment_instance table with proper conditions.
Please mark this response as correct or helpful if it assisted you with your question.
Regards,
Harshal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-12-2023 09:17 AM
can you kindly guide me so i can achieve this requirement , if you can provide the script i will be much appreciated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-12-2023 10:05 AM
Hi @mohammed-ahmad ,
Please refer below script -
var getAnswer = new GlideRecord("asmt_assessment_instance_question");
getAnswer.addEncodedQuery("instance="+current.sys_id);
getAnswer.addQuery("metric","sys_id of metric"); // Replace with sys_id of the metric record i.e sys_id of question in the survey
getAnswer.query();
if(getAnswer.next()){
if(getAnswer.value == "reopen"){ // replace with appropriate value
var updateInc = new GlideRecord("incident");
updateInc.get(getAnswer.task_id);
updateInc.state = 3; // replace with appropriate value of inprogress
updateInc.update();
}
}
Please mark this response as correct or helpful if it assisted you with your question.
Regards,
Harshal