- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 01:03 AM
I have written below script in Before Insert BR to Populate Correlation ID as TCSCE:{Number}. But number is not getting populated. screenshot below.
var abc = new GlideRecord("incident");
abc.initialize();
abc.correlation_id = "TCSCE:" + "{" + abc.number + "}";
abc.insert();
In output, All I am getting is as attached image below. Number is missing.
I guess it is happening, because Number value is not available for Before insert BR. But then how can I do this requirement?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 01:14 AM
You have to write after Business rule
current.correlation_id = "TCSCE:" + "{" + current.number + "}";
current.setWorkflow(false);
current.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 01:24 AM
Actually Incident is getting created via Integration. Correlation ID is already getting populated via Integration. I just have to change it to TCSCE{Number}.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 01:24 AM
Hi Ekta,
Before insert BR will not work as the number is not yet saved in the new record in database. You can write the same code with After Insert.
Please let me know if it works or not.