Workflow activity coding in IF statement in Problem Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2018 11:29 PM
Hi All,
I have to fix an issue in PM for which i was going through all BRs,CSs,UI actions, since we don't have any technical doc available.
But i am unable to find this since couple of days.
Here is issue:
A problem ticket when reaches Problem Review state , if Problem Manager rejects an approval it is opening some tasks which are already closed. My requirement is to open the latest closed task instead of more than one.
So the below 2 tasks are opening on rejection of an approval from PM. Not sure where it is triggering from. I want to take help of logs. How can i get these logs to investigate further.
Please let me know how to achieve this.
On rejection the state changes from Problem review to Pending change.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2018 05:14 AM
Thanks Slawomir for the response.
If someone can find if I miss anything in the code:
I was trying to check the code in the scripts background, before I put this into the IF statement in the Workflow activity
var all_task = new GlideRecord('problem_task');
all_task.addQuery('problem','0809e6b7db6ac740d50536fffe9619ae');
all_task.query();
var recom_lastmodified = new GlideDateTime();
var work_lastmodified = new GlideDateTime();
var rec_date= "";
var work_date="";
while(all_task.next()) {
if (all_task.u_task_subtype = 'Implement Recommendations') {
recom_lastmodified = all_task.sys_updated_on;
rec_date = recom_lastmodified.getGlideObject().getNumericValue();
}
elseif (all_task.u_task_subtype = 'Implementation Workaround') {
work_lastmodified = all_task.sys_updated_on;
work_date = work_lastmodified.getGlideObject().getNumericValue();
}
}
If I run only the if statement it is running fine: Giving rec_date in milliseconds
But if run the entire thing I am getting the below error: at line no 17 , expecting ;
[0:00:00.001] Script completed in scope global: script
Javascript compiler exception: missing ; before statement (null.null; line 17) in:
My next step is once I get Rec_date and Work_date
I want to check which is greater and accordingly open the respectivetask