VBScript Lua
This GSE action checks the status of an existing service issue.
Example call routing scripts can be found here A.3 - Example: Check Status and here A.4 - Example Check Status and Add Comment.
Configure action parameters
By double clicking a parameter in the list, you can edit it.
BaseURL Required
This is the ase URL of your Jira Service page, for example: https://my-service.atlassian.net
LoginUser Required
This is the email address of the Jira user you want to authenticate with. Please refer to 1 - Preparations for more details.
LoginToken Required
This is the API Token of the Jira user you want to authenticate with. Please refer to 1 - Preparations for more details.
IssueID Required
This is the id of the service issue you to check the current status for. The format of the id is typically PROJECTKEY-XXX, e.g. SUP-42
Configure action exits
Exit 0 (Default)
This exit will be reached if an invalid issue id was given or any kind of problem occured. It is recommmended to name this exit "Invalid ID/Failed".
If you reach this exit you can refer to 3.4 - Trouble Shooting to figure what went wrong.
Exit 9
This exit will be reached if an unknown status was returned by the Jira REST API. It is recommended to name this exit "Unknown Status".
If you reach this exit you can refer to 3.4 - Trouble Shooting to figure the returned status and modify your status mapping.
Dynamic Status Mapping
Jira service projects are highly flexible and depending on the selected template when you created your project and the made modifications, your project can have any number of different workflows and states.
This GSE action respects this flexibility and therefore doesn't have a fixed binding of states to block exits. All block exits 1 to 8 are of your free chosing.
To have something to start with, this GSE action assumes you used the Support template when you created your service project and haven't made any modifications in the workflows. This gives you a certain set of possible states, which by default are bound like this to the exits of the block:
Exit | States |
1 | Open, Waiting for support, Waiting for customer |
2 | Pending, In progress, Work in progress |
3 | Escalated |
4 | Canceled, Resolved, Done |
As already mentioned, you can modify this mapping to your precise needs. Just keep in mind that only the exits 1 to 8 are available to you.
All you need to do is to modify a global variable before you use the Check Status GSE action. This can best be done in a Insert Script Code block.
The content of the Insert Script Code block is then the definition of the mapping list, which is either a VBScript Array or a Lua Table. In both cases you are free to map any number of states to any exit (1..8).
Lets assume you want to map your own states State A and State B to exit 5 and State C to exit 6: This is the code you need to place into the Insert Script Code block:
For VBScript based call routing:
UseExit = 0 g_aJiraServiceStatusMapping = Array( _ "1;Waiting for support", _ "1;Waiting for customer", _ "1;Open", _ "2;Pending", _ "2;In progress", _ "2;Work in progress", _ "3;Escalated", _ "4;Canceled", _ "4;Resolved", _ "4;Done", _ "5;State A", _ "5;State B", _ "6;State C")
For Lua based call routing:
UseExit = 0 g_aJiraServiceStatusMapping = { "1;Waiting for support", "1;Waiting for customer", "1;Open", "2;Pending", "2;In progress", "2;Work in progress", "3;Escalated", "4;Canceled", "4;Resolved", "4;Done", "5;State A", "5;State B", "6;State C" }
As you can see, you are absolutely free in terms of the mapping of the different possible states of your service issue to an exit of the Run GSE Action block.
All you need to do is to do your mapping in the Insert Script Code block and afterwards open and name the exits of the Run GSE Action block accordingly.
An example of some own status mapping can be found in A.5 - Example: Check and Announce Status.
Additional return values (as global variables)
g_sLatestJiraIssueID (string)
This global variable holds the ID of the latest checked issue after the ok (0) exit has been reached.
g_sLatestJiraIssueStatus (string) 1.1.0
This global variable holds the status of the latest checked issue after the ok (0) exit has been reached.
The A.5 - Example: Check and Announce Status makes use of this variable to announce the status via AzureTTS (text-to-speech).
g_sLatestJiraIssueModified (string) 1.1.0
This global variable holds the latest modification date of the latest checked issue after the ok (0) exit has been reached.
The date is as the Jira API provides it, e.g. "2024-09-03T14:48:17.138+0200".
g_sLatestJiraIssueModifiedReadable (string) 1.1.0
This global variable holds the latest modification date of the latest checked issue after the ok (0) exit has been reached.
The date is in a better readable format, e.g. "03.09.2024 14:48:17".
The A.5 - Example: Check and Announce Status makes use of this variable to announce the latest modification date via AzureTTS (text-to-speech).
By Tom Wellige