How to send approval based on field updation in catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 05:20 AM - edited 01-03-2024 05:22 AM
Hello Experts,
I have created a catalog item. In the catalog item i have created 8 fields
1. Computer CI (referenced to cmdb_ci_computer table)
2.Name (String)
3.Install status ( Choice)
4.Assignment group (Reference)
5.Workshift (Choice)
6.Business Domains (referenced to business_unit table)
7.Application Service (referenced to application table)
8.Where it is used (referenced to cmn_location table)
Once user select Computer CI then all 7 fields will autopopulate.
Now my requirement is
1 . If user is updated only Name and Install status we want to send an approval to selected computer CI ==> owned by person.
2.If user is updated only Business Domains and Application Service then We want to send an approval to Selected Computer CI ==> Application Service==> Assignment group.
How to achieve this by using workflow...?
And my one more question is how to know that user how many fields updated or modified in catalog item.
Best Regards,
Nani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2024 04:05 AM - edited 01-04-2024 04:07 AM
Hello @Ankur Bawiskar
example 1: if user updated only name and install status then approval need to go selected computer CI ==> owned by person.
example 2 : If user updated only business domains and Application service then we need to send an approval to Selected Computer CI ==> Application Service==> Assignment group.
But the above script which you have shared it is not checking that user how many fields updated. without checking it will send 2 approvals.
My requirement is
( if user updated / modified existing value in name or install status fields in this case we need to send only one approval )
(if user is updated or modified existing value in all the fields in this case we need to send 2 approvals ).
Best regards,
Nani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2024 04:10 AM
nope.
The script is checking both the conditions 1st is in IF and 2nd is in ELSE IF
you need to add multiple ELSE IF based on your requirement
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 07:34 AM
Hello @Ankur Bawiskar
In my catalog item i have updated only business domains and Application service in this case approval need to go Selected Computer CI ==> Application Service==> Assignment group.
but here it is triggering 2 approvals.
1. Selected Computer CI ==> Application Service==> Assignment group.
2. selected computer CI ==> owned by person.
Above script which you have shared it is not comparing old value from table and new value which is enduser updated in catalog item.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 05:57 AM
Hi @Nani18 ,
As you mention that , all 7 fields will auto-populate means there is some onChange Catalog Client Script code already there which is reading the CI details from some cmdb_ci tables. So system knows the base value which are coming from some table.
Now, if the form values not matched with base values then it means user has changed it and based on that you can configure approval. Make sure you make provision if user update both the given statement (1) and (2).
-Thanks,
AshishKMishra
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution