Set approval based on variable in catalog task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2020 02:46 AM
Hi All,
We have a requirement to trigger an approval based on the value that is set for a catalog task variable. This field is not visible on the catalog form or the RITM but it is only visible on the catalog task.
When the task is assigned to a particular assignment group/user and if they set the 'Request Status' field to Approval for Production then an approval needs to be triggered to a specific user. All the fields on the task should be readonly until response is received from the approver.
For any other values in the Request status field approval should not be triggered and fields should be editable on the task.
Is it possible to trigger the approval in such a way?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2020 03:11 AM
hi,
yes you can trigger approval on specific choice of request status.
you can achieve this using workflow using approval activity and also you have to create ui policy to make all fields read only when request status is approval for production.
use workflow if you want to do something more like after approval you want to do like notify user and creation of new task.
or you can create business rule also to create record on approval table using before business rule
here in the script you have to specify whome you want to send approval
var gr= new GlideRecord('sysapproval_approver');
gr.initialise();
gr.setValue('approver','approver name');
gr.insert();
Thanks,
Manjusha Bangale

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2020 03:58 AM
Hello,
Have look on this,
If answer is helpful please mark correct and helpful!
Thanks,
Pratiksha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2020 03:13 AM
Hi all,
I have a similar requirement where in the approval should go to a variable manager ( variable name - instead of going to the requester opener manager.
example A opened the request for B and B"s manager is C
So approval request should go to C/
I know that I have to write a script in user activity advance section but not sure what it is .
I tried below 2 but did not work
=answer = [];
=answer.push(current.variables.requested_forPoweshell.sys_id);
=======
answer='';
if(curent.variables.requested_forPoweshell)
{
answer=current.variables.requested_for.manager.toString();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2020 02:03 AM
Hi all,
I have a similar requirement where in the approval should go to a variable manager ( variable name - instead of going to the requester opener manager.
example A opened the request for B and B"s manager is C
So approval request should go to C/
I know that I have to write a script in user activity advance section but not sure what it is .
I tried below 2 but did not work
=answer = [];
=answer.push(current.variables.requested_forPoweshell.sys_id);
=======
answer='';
if(curent.variables.requested_forPoweshell)
{
answer=current.variables.requested_for.manager.toString();
}