- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2018 06:53 PM
Hello
We are on Jakarta.
I have Workflow executing on Request Item. (sc_req_item) and is generating a REQ and RITM.
I found out that current.number will give me RITM number.
How can I find corresponding REQ number for the existing Workflow in progress?
Please advise.
Thanks,
Rajan Mehta
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2018 07:00 PM
you can use current.request
to get number you can do current.request.getDisplayValue()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2020 06:40 AM
Hi Mike ,
Im using run script to create incident.
var gr = new GlideRecord('incident');
gr.initialize();
gr.short_description = 'Mobile Device Troubleshooting';
gr.short_description += ' - ' + current.number.getDisplayValue();
gr.short_description += ' - ' +current.request.requested_for.getDisplayValue() ;
gr.parent = current.request;
gr.setWorkflow(false);
gr.setUseEngines(false);
gr.insert();
This is the run script in the beginning,
current.short_description = 'Hardware request';
current.short_description += ' - '+'Mobile Device';
current.short_description += ' - ' +'Mobile Phone';
current.short_description += ' - ' +current.request.requested_for.getDisplayValue() ;
current.short_description += ' - ' +current.variables.region ;
current.work_notes += ' - ' +current.request;// Isn't working..
I would like to update REQ and RITM number in INCIDENT work notes when it's created.
Please suggest something.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2020 06:55 AM
You need something like
var gr = new GlideRecord('incident');
gr.initialize();
gr.short_description = 'Mobile Device Troubleshooting';
gr.short_description += ' - ' + current.number.getDisplayValue();
gr.short_description += ' - ' + current.request.requested_for.getDisplayValue();
var notes = "Request Number: " + current.request.getDisplayValue();
notes += "\nRequested Item: " + current.number;
gr.work_notes = notes;
gr.parent = current.request;
gr.setWorkflow(false);
gr.setUseEngines(false);
gr.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2020 07:05 AM
Awesome this worked.
Thank you so much.
Now can you help me to update the Incident number in both REQ and RITM please?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2020 09:16 AM
try below
var gr = new GlideRecord('incident');
gr.initialize();
gr.short_description = 'Mobile Device Troubleshooting';
gr.short_description += ' - ' + current.number.getDisplayValue();
gr.short_description += ' - ' + current.request.requested_for.getDisplayValue();
var notes = "Request Number: " + current.request.getDisplayValue();
notes += "\nRequested Item: " + current.number;
gr.work_notes = notes;
gr.parent = current.request;
gr.setWorkflow(false);
gr.setUseEngines(false);
var id = gr.insert();
var ir = new GlideRecord('incident');
ir.get(id);
var INC = "Incident number: " + ir.number;
current.work_notes = INC;
var reqParent = current.request.getRefRecord();
reqParent.work_notes = INC;
reqParent.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2020 05:59 AM
Works perfect.
Thank u so much..
But some line in this code is updating REQ number in RITM work notes.
I don't want that.
I'm unable to figure out which line is that..