- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2024 06:37 AM
Hello Community,
I'm creating 'New Hire' Order Guide using 'Order Guide Sequential Fulfilment'. I have the below catalog items to be in a sequential order (New Hire account created first and the remaining three items will be created in parallel).
New Hire Account
Hardware Provisioning
Available Software/Application Request
Mobile Device Request
I want to get the new hire user sys_id from the first catalog item (New Hire Account) and use the value in the remaining catalog items 'Requested For' variable.
Can anyone please assist me with this.
Please let me know if you need more information.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 04:25 AM
To everyone who is looking for similar question, I have found the solution to it.
As part of the New Hire Account catalog item, a catalog task will be created which will be worked upon by an IT executive. Create a mandatory variable say, Username (mandatory on closure of the catalog task), hence the IT executive will have to add the Username of the newly created user before closing the task.
Get the value of the variable and do a GlideRecord on the User table to get the sys_id of the newly created user record.
Write a Business Rule in the catalog task on closure of the catalog task table to implement the functionality.
var uName = current.variables.username;
var grUser = new GlideRecord('sys_user');
grUser.addQuery('user_id', uName);
grUser.query();
if(grUser.next()) {
var user = grUser.getUniqueValue();
}
Now the user variable will contain the sys_id of the newly created user. Put this sys_id in the requested_for of the other RITMs of that particular Request.
var req = current.request_item.request;
var grRITM = new GlideRecord('sc_req_item');
grRITM.addQuery('request', req);
grRITM.query();
while(grRITM.next()) {
grRITM.requested_for = user;
grRITM.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2024 06:43 AM
Hi @tripu
As per my understanding , untill unless the new hire account did not get created ( means RITM must be closed) that will not reflect in sys user table.
So it is not possible to till RITM closed and user get created in database.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2024 10:36 PM
Hello @Dr Atul G- LNG,
You are correct... I already did that part.
Once the 'New hire account' is created, then only create the remaining three items.
My question is, when the 'New Hire account' is already created, how to get that user sys_id and place the sys_id in the remaining item's 'Requested For'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2024 01:02 AM
Hi @tripu
I am not a developer/coder but I thinking from the process side. So to guide , 1st is a new account, and once that is created , then rest of RITM Need to work. It means we need to put a logic to hold / delay the rest 3 RITM till the 1st one is completed.
Something similar need to do:
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 04:59 AM
QA test automation presents challenges like high initial setup costs, maintenance of test scripts, and test environment instability. To address these, start with a cost-benefit analysis and gradually expand automation. Regularly update test scripts to maintain relevance, and use stable environments through virtual machines or cloud services. Flaky tests, caused by timing issues or dependencies, should be promptly fixed to maintain trust in automation. Prioritize test cases based on risk and critical functionality to ensure effective test coverage. Strategic planning and focused efforts can significantly enhance the benefits of QA test automation.