This page documents the request create property panel module for Jira Service Desk.
The request create property panel is displayed on the request creation screen in the customer portal and enables apps to save arbitrary data during request creation as Jira issue properties. For more information on Jira entity properties see Jira Entity Properties.
serviceDeskPortalRequestCreatePropertyPanels
1 2... "modules": { "serviceDeskPortalRequestCreatePropertyPanels": [ { "key": "sd-portal-request-create-property-content", "url": "/sd-portal-request-create-property-content" } ] } ...
key
string (^[a-zA-Z0-9-]+$)
url
string
, uri-template
weight
integer
conditions
Jira Service Desk provides a JavaScript API that the app will need to use in order to store and validate its data.
Your app will need to listen for the following events that Jira Service Desk will trigger, and respond to each event by calling the corresponding API method with the response.
Your app must call the corresponding API method immediately. There must not be any asynchronous operations done between receiving the event and calling the API method.
jira-servicedesk-request-properties-serialize
serialize(object)
must be called with the result of this eventjira-servicedesk-request-properties-validate
validate(isValid)
must be called with the result of this event1 2/** * Provides Jira Service Desk with the data that will be stored as issue properties. * * Must only be called in response to the jira-servicedesk-request-properties-serialize event * @param {Object} object - An object, where the key is the issue property key that will be used and a value for that issue property * e.g: serialize({issue_prop: 123, issue_prop_2: 456}) will result in two issue properties being created against the issue with the given values. * The values of the issue properties need not be primitive values but can be any JS object. */ serialize(object) /** * Provides Jira Service Desk with the result of the validation of the panel. * If called with "false", the user will not be able to create the request. Ideally, this would be the time the * app would render an error message notifying the user that the data they might have entered in the panel is invalid. * * Must only be called in response to the jira-servicedesk-request-properties-validate event * @param {Boolean} isValid - Whether the panel's data is valid and can be saved * */ validate(isValid)
This is an example script for a simple panel that asks the user to enters their location in the field #location
.
This panel will store the location data in the issue property location_issue_property
.
1 2$(function () { var requestProperties = new AP.jiraServiceDesk.RequestProperties(); AP.events.on("jira-servicedesk-request-properties-serialize", function() { requestProperties.serialize({ com_company_myapp_location_issue_property: $("#location").val() }); }); AP.events.on("jira-servicedesk-request-properties-validate", function() { var valid = true; if (!$("#location").val()) { $("#location").parent().append("<p class='field-error'>location can't be empty</p>"); valid = false; } requestProperties.validate(valid); }); });
Rate this page: