I need to set the Priority of Tasks which would be same as RITM priority
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2018 12:59 AM
When a catalog item is raised, based on some criteria, the priority of RITM gets changed. Now the Tasks are getting generated with default p4. I need to set te Priority of these Tasks to be same as RITM Priority.
This is code which i tried using BR.
function onBefore(current, previous) {
var gr = new GlideRecord('sc_task');
gr.addActiveQuery();
gr.addQuery('request_item',current.sys_id);
gr.query();
if(gr.next()){
gr.priority= 3;
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2018 01:18 AM
Hi,
Just to clarify, this is a before insert/update rule on the sc_task table yes? If you need the task priority to be the same as the RITM priority when it's raised then you should be able to just dot-walk to the value.
current.priority = current.request_item.priority
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2018 01:31 AM
Hi yes, it was Before BR.
I tried using the above but still the Tasks Priorities are not getting changed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2018 01:58 AM
I just configured this on my dev instance and it works as expected. When you hit the new button it will raise the form with the default value but as long as you enter the RITM before you hit save it should amend the priority. If you have changed the priority choice options on either the request item or catalog task form you may need to ensure the values are consistent.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2018 01:35 AM
If the task is generated from workflow, can you not put David's suggestion into the "create task" item in the workflow?