need to get HR case number created using Record Insert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Using ATF, I have created an HR case in sn_hr_core_case table using Record Insert step .
I need the HR case number & Created date to validate in further steps.
I have also tried Record Query, which gives me only the sys ID of the HR case record created. I need HR case number & created date. Can anyone help me?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @PraveenaD
Refer:
How do I get case number from record in ATF?
Also check
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
the only option is to use Custom step
I shared solution back in 2022 for this, check and enhance
How do I get case number from record in ATF?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Thanks for the quick response but am getting a error as "The step result was not set correctly, all steps must be set to success or failed"
And i have also tried to set an else loop below the if, And it still failed with empty Summary in ATF
Can you please help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
you didn't do it properly in script
the error clearly says you should set either success or fail in your script
(function executeStep(inputs, outputs, stepResult, timeout) {
var sysId = inputs.u_sysid;
var tableName = inputs.u_tablename;
var gr = new GlideRecord(tableName);
gr.addQuery("sys_id", sysId);
gr.query();
if (gr.next()) {
outputs.u_number = gr.getDisplayValue();
stepResult.setOutputMessage("The number found.");
// Set the official step status to success
stepResult.setSuccess();
} else {
// Fallback or explicit failure logic
stepResult.setOutputMessage("Something went wrong.");
stepResult.setFailed();
}
}(inputs, outputs, stepResult, timeout));
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader