- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2024 11:33 PM
I have a requirement from one of our catalog item (New User Account Request).
The workflow of this is once approved, it will generate the 1st task = Access Provisioning - Domain.
Then once the Access Provisioning - Domain is closed, another tasks are generated. Once of the is "Access Provisioning - Office 365 Email".
The customer requested that who ever closes the Access Provisioning - Domain should be automatically assigned to the 'Access Provisioning - Office 365 Email' task.
How to achieve this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2024 12:30 AM
I have my solution here.
In the workflow Activity Properties for the Catalog Task "Access Provisioning - Office 365 Email", I checked the Advanced and add script below.
var domainTask = new GlideRecord('sc_task');
domainTask.addQuery('short_description', 'Access Provisioning - Domain');
domainTask.addQuery('parent', current.sys_id);
domainTask.addQuery('state', 3); // Check if it's closed complete
domainTask.query();
if (domainTask.next()) {
// Assign the O365 task to the user who closed the Domain task
task.assigned_to = domainTask.closed_by; // closed_by field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2024 12:13 AM - edited 10-21-2024 12:19 AM
Write a business rule on the sc_task table and set it similarly:
- triggered on Update,
- condition: state changes (moves) to Closed Complete or Closed Incomplete,
Then you can set the fields without a line of code:
PS: this will be applied to all the SCTASKs, if you want to have it for just one particular item, it needs to be adjusted accordingly in the conditions
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2024 12:30 AM
I have my solution here.
In the workflow Activity Properties for the Catalog Task "Access Provisioning - Office 365 Email", I checked the Advanced and add script below.
var domainTask = new GlideRecord('sc_task');
domainTask.addQuery('short_description', 'Access Provisioning - Domain');
domainTask.addQuery('parent', current.sys_id);
domainTask.addQuery('state', 3); // Check if it's closed complete
domainTask.query();
if (domainTask.next()) {
// Assign the O365 task to the user who closed the Domain task
task.assigned_to = domainTask.closed_by; // closed_by field