Inbound action script help for stripping only computer name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 10:16 AM
Hello I need to create an Incident when an Email from xyz is being sent to servicenow , but email might have some computer names which I need to only get those names and set it in Description of Incident ,
Below is the email which we will get and we only want computer names under Problematic BCA clients .
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
// Fix script: Populate blank fields in Planned Outage based on Acceptance Criteria
(function() {
var outageGR = new GlideRecord('change_outage');
outageGR.addQuery('type', 'planned'); // Only Planned Outages
outageGR.query();
while (outageGR.next()) {
// Skip if parent CR is missing
if (!outageGR.change_request)
continue;
var cr = outageGR.change_request.getRefRecord();
// AC3: Only update if Parent CR is ACTIVE
if (cr.state == 3 || cr.state == 4) {
// 3 = Closed, 4 = Cancelled (varies by instance)
continue;
}
var updated = false;
// AC1 + AC2: Populate fields only if blank
if (!outageGR.cmdb_ci) {
outageGR.cmdb_ci = cr.cmdb_ci; // Primary CI of CR
updated = true;
}
if (!outageGR.begin) {
outageGR.begin = cr.start_date; // Planned Start date of CR
updated = true;
}
if (!outageGR.end) {
outageGR.end = cr.end_date; // Planned End date of CR
updated = true;
}
if (updated) {
outageGR.update();
// AC4: Add work note to Parent CR
cr.work_notes = "Fix script: Planned Outage record '" + outageGR.number +
"' updated with mandatory fields.";
cr.update();
}
}
gs.print("Fix script completed successfully.");
})();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
You are given all the details for a change request.
{{short_description}}
{{description}}
{{priority}}
{{state}}
{{other_fields.all_remaining_attributes}}
{{relatedlists_data.all_remaining_attributes}}
An array of activities from activity stream with created date, its type such as a comment or work note and the text: {{activities}}
Summarize every detail mentioned above, as requested in the following sections:
- Prompt
Put the following in the Prompt section: "WF Change summarization Implement and Review v3"
- Objective
In the Objective section, offer a paragraph summarizing basic details of the change request and additionally give justification if available.
- Approvals
Provide the groups from which approval is requested with the state of the approval record
- Plan
The plan section provides a paragraph with emphasis on implementation plan, including test plan and back out plan for the change request. Include the details of the change Tasks for the given change looking at the relatedlists_data section.
- Risk
Firstly, only from given information, explain in a paragraph the risk involved in the implementation of this change request. Secondly, check below conditions and provide corresponding text: 1. If there is no scheduling conflict section, say that "The conflict status of this change request is <Conflict status for change request>". 2. If the scheduling conflict section is set as "Too much information," say that "There is too much information on conflicts to be shown." 3. If the scheduling conflict section is available, display the conflict count as, "<Conflict count> conflicts are associated with this change request" and mention a few type of conflicts from the scheduling conflict section.
- Applied policies
Only based on information in APPLIED CHANGE POLICY section, provide corresponding text:
Provide the Applied Change Policy count listed within that section, formatted as, "<Applied Change Policy count> policies were applied to this change request." The data for one of these change policies will also be available in the APPLIED CHANGE POLICY section; referring to this data, additionally return the policy's name and the actions taken for it, formatted as, "The latest applied change policy is <Applied change policy's name>, for which the action taken was <Action taken regarding this policy>."
- Affected CIs
Based on only the AFFECTED CONFIGURATION ITEM section, check below condition and provide the information in one line: If AFFECTED CONFIGURATION ITEM section is available, say "<Configuration items count> configuration items are affected," and then mention only up to three of them.
- Impacted services
Based on only the IMPACTED SERVICE section, check below condition and provide the information in one line: If IMPACTED SERVICE section is available, say "<Services count> services are impacted," and then mention only up to three of them.
Only use the provided information and generate content only for the sections listed above in JSON format with all field-value pairs. Make sure to always respond with full sentences and to include all details/entities mentioned. Do not generate any information which is not provided. If you are not absolutely sure, return N/A for that section. DO NOT GENERATE ANY EXPLANATION, REASONING, COMMENTARY OR DESCRIPTION ABOUT THE SUMMARY.
{<section_name>: <section_details>}