- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2016 12:42 PM
Hello,
I am trying to add the incident number and short description to the survey. I can add the incident number to the email but I would like it to appear directly within the survey take page.
I found one suggestion to pass the parameter of the incident number through the URL and default the value of a question on the survey to javascript:RP.getParameterValue("incidentnum") but I do not see a field for the default value of a question. I could find the field in the legacy survey but not under the new surveys in Fuji.
How do I add the incident number and description into either the survey intro or somewhere on the survey take page?
thank you,
Jackie
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2016 09:17 PM
My apologies Jackie - I just assumed that survey was a system delivered UI page since it sounded like it was. I looked at ours a little closer - survey was a page we created based off of assessment_take2 (so that we would not lose the future updates). The code above was put inside this tag: <div class="assessment">, you can play with it to get it in the right spot on the page.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2016 10:31 PM
Hi Trevor,
Even I have the same requirement, adding INC number & short description to the Survey page & not the email notification (which already has the INC details)
When I tried to add the above code in assessment_take2 UI page under div class="assessment" as shown below the Survey still doesn't display the INC details.
Am I missing here something here mate ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2016 08:24 PM
Well you are - but that's because it looks like I missed copying the piece before. You'll notice it relies on "instanceGR" to know what record to pull - it looks like I forgot to copy that part in.
<table class="wrap"> | ||||||||||
<tbody> | ||||||||||
<g2:evaluate var="jvar_type" | ||||||||||
expression="var typeGR=''; | ||||||||||
var instanceGR = new GlideRecord('asmt_assessment_instance'); | ||||||||||
instanceGR.addQuery('sys_id', '${jvar_assessable_sysid}'); | ||||||||||
instanceGR.query(); | ||||||||||
if (instanceGR.next()) { | ||||||||||
typeGR = new GlideRecord('asmt_metric_type'); | ||||||||||
typeGR.addQuery('sys_id', instanceGR.metric_type); | ||||||||||
typeGR.query(); | ||||||||||
} | ||||||||||
" /> | ||||||||||
<j2:if test="$[typeof typeGR == 'object']"> | ||||||||||
<j2:if test="$[typeGR.next()]"> | ||||||||||
<div style="background-color: #767676;margin-top: 2px;font-weight: bold;padding: 2px 6px 2px 6px;color: #ffffff;"> | ||||||||||
<img src="images/context.gifx"></img> | ||||||||||
$[typeGR.name] | ||||||||||
</div> | ||||||||||
<!-- end_note may contain HTML formatting --> | ||||||||||
<g2:no_escape>$[NS:typeGR.introduction]</g2:no_escape> |
<div align="center" style="width:100%; border:1px solder red;"> | ||||||||||||||||||||
<div align="left" style="font-weight: bold;padding-bottom:5px; margin-bottom:0px;">Assessable Record Detail: </div> | ||||||||||||||||||||
<div align="left"> | ||||||||||||||||||||
<g2:evaluate var="jvar_record" | ||||||||||||||||||||
expression="var recordGR=''; | ||||||||||||||||||||
gs.log(instanceGR.trigger_table + ' ' + instanceGR.trigger_id); | ||||||||||||||||||||
var recordGR = new GlideRecord(instanceGR.trigger_table); | ||||||||||||||||||||
recordGR.addQuery('sys_id', instanceGR.trigger_id); | ||||||||||||||||||||
recordGR.query(); | ||||||||||||||||||||
" /> | ||||||||||||||||||||
<j2:if test="$[typeof recordGR == 'object']"> | ||||||||||||||||||||
<j2:if test="$[recordGR.next()]"> | ||||||||||||||||||||
<div style="margin-bottom:0px;"><b>Incident number:</b> | ||||||||||||||||||||
$[recordGR.number] | ||||||||||||||||||||
</div> | ||||||||||||||||||||
<div style="margin-bottom:0px;"><b>Description:</b> | ||||||||||||||||||||
$[recordGR.short_description] | ||||||||||||||||||||
</div> | ||||||||||||||||||||
</j2:if> | ||||||||||||||||||||
</j2:if> | ||||||||||||||||||||
</div> | ||||||||||||||||||||
</div> |
</j2:if> | ||||||
</j2:if> | ||||||
<g2:com.snc.assessment_core_take | ||||||
assessment="${jvar_assessable_sysid}" /> | ||||||
</tbody> | ||||||
</table> |
This is the entire section between the assessment div tag.
EDIT: Sorry - I think this might have pasted horribly with a bunch of empty lines. In my instance, this is lines 207-259 of code, so that's how many lines you should get.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2016 07:02 PM
Brilliant !! Works like a charm now. Thanks Trevor...
But I see the issue was with Assessment instances without Trigger IDs that were causing me some issues. Its looks like this under the Assessment instances :
So for Surveys without trigger values, the INC number & short description wouldn't work. This could turn out to be a potential issue.
Have you guys faced this type of issue earlier ? Need some help here please...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2016 09:22 AM
Sorry for the late response - I was off on vacation.
We have never faced that issue. There are just over 14,000 survey instances in our system and 17 of them have an empty trigger value - and all 17 were surveys done while testing (based on the dates being our earliest ones). So I'm not sure this would really be an issue if you rely on your trigger conditions for the survey, at least according to our experience.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2018 01:49 AM
Hi Suhas,
We faced the same issue earlier in our project,
This trigger id field is blank when you assign a survey manually to any user using assign survey button.