Create a Problem from Incident UI action issue copying INC assignment group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2019 12:10 PM
I am unable to get my NOW Learning task to complete successfully.
I need to create a new problem from an incident with all necessary information. The following fields should be copied from an incident when a new problem is created from an incident: Configuration item, Priority, Assignment group, Short Description, Description.
The OOTB has all configured except the assignment group. I've tried modifying the Script for the Create Problem (incident table) UI Action. I added a line:
prob.assignment_group == current.assignment_group;
this gives me an error "Expected an assignment or function call and instead saw an expression. I understand the error message, but don't know what I needed to do to get the correct answer to solving this task.
Please instruct me on what the correct answer is and why so I can understand and learn.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2019 12:26 PM
Have you tried:
prob.setValue("assignment_group", current.assignment_group);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2019 12:26 PM
Or try:
prob.setDisplayValue("assignment_group", current.assignment_group);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2019 12:35 PM
This didn't work. Attaching what is in my Create Problem UI action for Incident table:
var prob = new IncidentUtils().getProblemFromIncident(current);
if(prob != undefined) {
current.problem_id = prob.insert();
var mySysID = current.update();
gs.addInfoMessage(gs.getMessage("Problem {0} created", prob.number));
prob.setValue("assignment_group", current.assignment_group);
action.setRedirectURL(prob);
action.setReturnURL(current);
} else {
action.setRedirectURL(current);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2019 12:37 PM
HI,
I think you are in new york or madrid.
So there are few things important to look after:
1) Script include:
IncidentUtilsSNC and function getProblemFromIncident which is called from UI Action.
2) Check for the property : com.snc.problem.create_from_incident.attributes
if this property is not present then create this property and add all attributes you want to copy.
Thnaks,
Ashutosh