Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 17 Next »

Introduction

JEMHC is currently unable to automatically determine values required to populate the customer request type field during issue creation due to current limitations of the JIRA Cloud API. A workaround exists to extract the required values from a backup export of your JIRA instance, which will allow JEMHC to correctly populate the customer request type field during issue creation. When setting the customer request type field, JEMHC must provide a key value in the format projectKey/requestTypeKey you will need to follow the steps below to acquire the request type key. This is not a straightforward process so if you require further guidance on this then please create a support request.

The customer request type field can only be applied during issue creation at this time. Due to limitations in the JIRA API, if the field is attempted to be updated during issue comment, an internal server error is returned and the request type is therefore not updated. It is advised that you scope the customer request type custom field default to only apply on issue creation til this issue is resolved. Similarly it is currently not possible to update the customer request type field via an email supplied directive on issue comment, customer request type can only be applied by directives during issue creation.

A supplied customer request type must be valid for both the project and issue type of the issue being created. Supplying a customer request type that is invalid either for the project the issue is being created in or the issue type of the created issue will result in the field not being set. You can check the issue types that request types are scoped to within your JSD project settings.

Locate customer request type keys via the JIRA REST API for a service desk issue

Currently customer request type keys are not exposed via a public REST API that JEMHC can interact with, there is a non-public REST API behind the scenes that service desk uses which can be accessed via a browser to determine customer request type keys. 

1.) Determine the issue ID of a service desk issue

All service desk issues have a unique numerical ID, this ID is not the same as an issue key. To locate the issue ID for a service desk issue, browse to the URL below, replacing YOUR_HOSTNAME with the hostname of your JIRA cloud instance, and ISSUE_KEY with a valid issue key for an existing service desk issue that contains the request types you would like to gather keys for.

https://YOUR_HOSTNAME.atlassian.net/rest/api/2/issue/ISSUE_KEY

Browsing to the above URL should return a JSON response from the JIRA cloud rest API containing issue information, the top of this response should contain an issue ID:

2.) Determine the service desk ID of a JSD service desk via the JSD REST API

All service desks have a unique numerical ID within JIRA, you can generate a list of these ID's by querying the REST API for JSD at the URL below (replacing YOUR_HOSTNAME with the hostname of your JIRA Cloud instance):

https://YOUR_HOSTNAME.atlassian.net/rest/servicedeskapi/servicedesk

The result of browsing to the above URL should be a JSON response containing a list of all service desks that exist within JIRA. Locate the project that the issue from step one exists in, it's ID should be present within the data for the service desk. Our issue in step 1 was created in the project with the key of SUPPORT, so we find the matching service desk in the JSON response and make note of it's ID:

3.) Combine the service desk ID and the issue ID and query the request type keys for the issue

The combination of the service desk ID and issue ID will allow you to query the JSD API to retrieve a list of customer request type keys, gather both ID's from step 1 and 2 above and then browse to the URL below (replace SERVICE_DESK with the service desk ID and replace ISSUE with the issue ID, replace YOUR_HOSTNAME with the hostname of your JIRA cloud instance):

https://YOUR_HOSTNAME/rest/servicedesk/SERVICE_DESK/servicedesk/request/ISSUE/request-types

Browsing to the above URL with a correct issue ID and the correct service desk ID for the associated issue will result in JIRA returning a JSON response containing all customer request types within the service desk:

The "key" field contains the unique key for each request type.


Locate customer request type key via database export

Generate an XML export of your JIRA Cloud instance via the backup manager

The keys required to set the customer request type value must be manually extracted from a database export generated from your JIRA cloud instance. First of all make sure that the request type you are attempting to set has been created and used once on an existing issue, then follow the steps below.

Browse to JIRA Administration → Import and Export → Backup Manager. Untick Include additional files (attachments, avatars, and logos) in the backup and then press Create backup for server

An export of your JIRA Cloud database will be generated in the background, once the export if ready to download a Download Backup File button will appear, pressing this button will download a .zip file containing some XML exports of the JIRA Cloud database.

The file containing the customer request type keys is acticeobjects.xml, see the next for instructions on how to extract the keys from the file.

Locate and extract customer request type keys from activeobjects.xml

Open the activeobjects.xml file in a text editor, the table name AO_54307E_VIEWPORTFORM contains the data we need to extract, search the xml file for <data tableName="AO_54307E_VIEWPORTFORM"> which should result in you finding a section similar to the one shown below:

Between the <row> tags each customer request type is shown along with some attributes associated with the request type. Between one of the pairs of <string> tags there is a unique key that is assigned to the request type, this is the unique key that is required to allow JEMHC to automatically set the customer request type on issue creation. In the example above the unique key for the "Get IT Help" request type is getithelp and the unique key for the "Licensing" request type is d38c11e7-3316-46d2-9fc6-831d39fd4b5d. Default request type keys are usually lowercase strings that may contain dashes, custom request type keys are stored as GUIDs.

Configure a JEMHC project mapping to set the request type during issue creation

A default customer request type key can be configured within a JEMHC project mapping via the Project Mapping → Issue → Custom Field Defaults → Customer Request Type field. The value you enter into this field must follow the format of prpject key/request type key. For the example above where the request type key was getithelp and the project key was RJ you would use a value of rj/getithelp

  • No labels