...
3. In the workflow details view, click Edit workflow.
4. Create a the Call function node for obtaining the authorization details. In the Function name field, specify the wf.itsm.ticket.get_authorization_header
function, which returns Session Auth Token
. Save the result in a variable . For example, it can be (in this sample it is user_token
).
...
5.
It returns the request status by ID or key.
We are creating a workflow that:
1. Obtaining the authorization using call function (above)
2. Asking user the request key
3. Getting ready the pass (Create the Ask node to ask a user their request key. Save the result in a variable (in this sample it is user_ticket
).
...
6. Create the Save to short term memory node, name the property (in this sample it is get_request
) and specify the method, as it is described in the Atlassian reference documentation).
...
4. Everything is ready for 7. Create the Web service node
5. Path is in URI field
6. In headers / auth we add auth that we got after call function
7. to get ticket status in patterns fields we are adding an variable for storing ticket status. the . Specify the URI, the API method type (as it is defined in the Atlassian documentation), headers (the Authorization
comes from the first Call function node; Accept = application/json
), and the pattern.
To get and utilize the ticket status later on in our workflow, in the Patterns section add a variable for storing the status. The value of this variable corresponds to the path in the response json object JSON object. For instance, the status in this case is $.currentStatus.status
testing
#workflow workflowname.
...
8. Click Save. Now you can test your workflow.
9. Open the chat and type the #workflow <workflow_name>
chat command. In out sample, it is #workflow APItest
.
10. Enter the key of your ticket and see its status. To check that everything is correct, you can open the ticket separately and make sure the result is accurate.