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
‎01-30-2018 01:19 AM
Check Business Rules on Problem table and Problem Task table. They should be responsible for opening task based on condition.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2018 07:18 AM
Hi slawomir,
I have finally found a workflow that is triggering. I am new to workflow activity coding. Need some help on this.
Scenario is Currently after all problem tasks are closed , the problem reaches to Problem review state
Now if Problem manager rejects in review state.
Following tasks are opening:
Task1: Problem Implementation task - Work around
Task2: Problem Implementation task - Recommendation
Now i need how to write the code in If statement such that which ever task is closed last , that task should only open instead of opening both.
Below is the sample workflow activity we have, I don't have visio to present it in decent way.
Any suggestions from you is highly appreciated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2018 07:21 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2018 07:57 AM
You go to Activity IF and add script which will compare dates
I am not very good at scripting as well so I am sure there is easier way to do it...
var task1 = new GlideRecord('problem_task');
task1.addQuery('problem', current.sys_id);
task1.addQuery('short_description', 'task 1'); /you have to somehow find task1
task1.query();
var task2 = new GlideRecord('problem_task');
task2.addQuery('problem', current.sys_id);
task2.addQuery('short_description', 'task 2'); /you have to somehow find task2
task2.query();
if (task1.updated>task2.updated)
return 'yes';
else
return 'no';