AnsweredAssumed Answered

Passing form values to function - Create Incident button on issue

Question asked by Grant Bruneau Champion on Apr 13, 2016
Latest reply on Apr 15, 2016 by Grant Bruneau

Hi Community,

 

I'm trying to add a Create Incident button on an issue so that Analysts can easily create Incidents from Issues.  I've got this working but am having trouble passing my custom Affected Service and CI fields.  We have a specific use case where we've found Issue to be the best record to capture downtime information.  Everything else appears to be working, this form was taken from the create problem button on Incident.  I'm not sure what I'm missing to get the CI and Affected Service passed correctly..  Any help is appreciated!

 

The Issue schema has been mirrored similar to Incident.  For example,  Affected Service is zaffected_service and CI is zaffected_resource.

 

Here's the form I've added to detail_iss:

<form name="create_incident">
<input type="hidden" name="SET.customer" value="$args.log_agent">
<input type="hidden" name="customer_combo_name" value="$args.log_agent.combo_name">
<input type="hidden" name="SET.assignee" value="$args.assignee">
<input type="hidden" name="assignee_combo_name" value="$args.assignee.combo_name">
<input type="hidden" name="SET.group" value="$args.group">
<input type="hidden" name="group_combo_name" value="$args.group.combo_name">
<input type="hidden" name="SET.urgency" value="2">
<input type="hidden" name="SET.impact" value="3">
<input type="hidden" name="SET.affected_resource" value="$args.zaffected_resource">
<input type="hidden" name="KEY.zaffected_resource" value=<PDM_FMT ESC_STYLE=C>"$args.zaffected_resource.COMMON_NAME"</PDM_FMT>>
<input type="hidden" name="SET.affected_service" value="$args.zaffected_service">
<input type="hidden" name="KEY.zaffected_service" value=<PDM_FMT ESC_STYLE=C>"$args.zaffected_service.COMMON_NAME"</PDM_FMT>>
<input type="hidden" name="SET.summary" value=<PDM_FMT ESC_STYLE=JS2>"$args.summary"</PDM_FMT>>
<input type="hidden" name="SET.description" value=<PDM_FMT ESC_STYLE=JS2>"(Created from Service Interruption $args.ref_num)
$args.description
"</PDM_FMT>>
</form>

 

And the button:

<PDM_MACRO name=button Caption="Create Incident[!ea]" Func="create_new('cr',0,0,0,'PRESET=type:I','INITFROM=create_incident')" hotkey_name="Create Incident[!ea]" ID=ITIL_INCIDENT>

Outcomes