How can you show a variable from a catalog item on an Incident or Incident Task

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2014 11:55 AM
Can someone tell me the easiest way to show a variable from a catalog item on an Incident or Incident task. Do I need to do a catalog UI policy with or without scripts? Please let me know.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2014 08:01 AM
Sometimes the variables you have in your record producer does not have a one to one relationship to a field on the form.
For example, on our record producer for creating an incident we ask a number of questions that do not have a 1 to 1 relationship back to the incident field. They are used so we can better understand what the problem is
For example:
What type of issue are you experiencing? (Desktop, Email, Printer, or Phone)
If they answer Email, we then ask additional questions such as:
Can you open the application?
Can you access your inbox?
What error message are you receiving?
We take those answers as well as the questions and populate them into the current.description field on the incident form like so:
var descriptionarray; |
current.short_description = "Self Service Email Issue";
descriptionarray += producer.email_question_1.getGlideObject().getQuestion().getLabel() + " " + producer.email_question_1 + "\n";
descriptionarray += producer.email_question_2.getGlideObject().getQuestion().getLabel() + " " + producer.email_question_2 + "\n";
descriptionarray += producer.email_question_3.getGlideObject().getQuestion().getLabel() + " " + producer.email_question_3;
current.cmdb_ci = "Outlook";
current.category_1 = "Email";
current.description = descriptionarray;
This gives this kind of view in the description of the incident:
Benefit of doing it this way is you can change the label of your variable multiple times and you never will need to change the code since it will dynamically pull back the question.
Probably more detail than you want, but I found this extremely helpful when I was building out our Incident Record Producer and providing the information of the options the user selected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2014 09:56 AM
Very cool bburdick!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2016 07:54 AM
Hi guys,
I'm struggling with the very similar issue as the OP, I used the script just like the one provided above, but there's still sth that isn't right.
In my case I created a Problem RP, and all the fields from the RP are being populated correctly into Problem Record, apart from one: Problem Summary, would you mind taking a look at my script and point out my mistake?
gs.include("FormInfoHeader");
var fi = new FormInfoHeader();
current.state =2;
var s = 'Problem ' + current.number + ' has been submitted.<br/>';
s += 'The Problem Management team will contact you if they need any additional information<br/>';
fi.addMessage(s);
//gs.addInfoMessage(s);
current.Summary = producer.issue_summary;
current.description = producer.describe_the_issue +"\n\nImpacted applications:\n" + producer.impacted_applications;
current.business_impact = producer.business_impact;
current.u_type.setValue(4);
//producer.redirect = 'sc_request.do?sys_id=' + current.sys_id
producer.redirect = "catalog_home.do";
Thank you!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2016 12:28 AM
Hi Joanna,
I really think that script is ok in general, but you just need to check filed (or variable) name, since I suppose "summary" is not OOB one.