To enhance ServiceBond for Jira, you can configure the Jira Meshlet to the directives listed below:


DirectiveDefault ValueDescription

sessionAuth

true

Indicates whether you want to authenticate your Jira connection with session IDs instead of basic authentication. 

(info) NOTE: This directive only works with Jira server, thus, you will need to set server to true. (See the next directive).

perspectium:
	jira: 
		sessionAuth: true

The following example enables the use of session IDs for your connection: 

perspectium:
	jira: 
		server: true
		sessionAuth: true
servertrue

Enable the use of the Jira server for your Jira connection. 

(info) NOTE: This directive needs to be enabled in order to use the sessionAuth configuration.

perspectium:
	jira: 
		server: true
useTransitionsfalse

(info) NOTEThis feature is available in Krypton 8.03+

Enables you to use your own mappings for handling transitions in Jira.

perspectium:
	jira:
        transition: 
            useTransitions: true

By default, the Jira meshlets will call the transitions API with just the ID value from the Common Document's <state> field:

{
    "transition": {
        "id": "${JSON_ENCODE:$[XPATH:/common_incident/state]}"
    }
}

However if you want to use your own mapping that you define in the static/mapping/default folder of the meshlet's installed directory, you would set the useTransitions configuration to true and then add your own mapping and define it for use in the static/config/fieldMapping.json for the transition action. 

For example, if you wanted to also map the resolution field and add a comment for a transition, you would add the following mapping named transition.json into the static/mapping/default folder of the meshlet's installed directory:

{
    "transition": {
        "id": "${JSON_ENCODE:$[XPATH:/common_incident/state]}"
    },
    "fields": {
        "resolution": {"id": "${JSON_ENCODE:$[XPATH:/common_incident/close_code]}"}
    },
    "update": {
        "comment": [
            {
                "add": {"body": "${JSON_ENCODE:$[XPATH:/common_incident/close_notes]}"}
            }
        ]
    }
}

And then in the static/config/fieldMapping.json you would reference this mapping for the transition action:

{
    "Source":"common_incident",
    "Target":"issue",
    "Action":"transition",
    "Description":"transition Jira status",
    "Provider":"jira",
    "Client":"default",
    "Mapping":"${file:static/mapping/default/transition.json}"
}

(info) NOTE: To properly do transitions with a mapping in your Jira project such as the above example with setting the resolution field, you must have a transition with a screen in your workflow. See here and here for more information. Jira provides a default Resolve Issue screen you can set for the transition. If you do set up a transition with a screen in your workflow, you will get the error Field 'resolution' cannot be set. It is not on the appropriate screen, or unknown. when trying to do a transition with the resolution field.

  • No labels