Skip to main content

Designing an example action: Create issue in Jira

Learn how to design an action that creates an issue in Jira.


Step 1: Create an app

  1. Go to My apps page and add a new app by selecting Start from scratch option.
  2. Enter a name and a description for your app. You can optionally upload an icon.

Step 2: Connect to Jira

  1. Go to App settings tab and click Add connection.
  2. Select Jira as the connection type. Enter a name for your connection.
  3. You'll be directed to the page where you can update the connection properties.
  4. Go back and click Connect near Jira connection. Enter your Jira instance's URL, your login email and API key on the opening screen.

Step 3: Create your action

  1. Go to Actions tab and click Add action.
  2. Enter a name for your action. You can optionally enter a description, tags and aliases.
Info

Tags are used to manage and filter your actions while aliases can be used as the nicknames for your actions. Your action can be navigated with typing either its name or any of its aliases.

Step 4: Create your inputs

Before starting this step, let's plan our action ahead. Although most Jira issues might require multiple fields, we'll design this action with the most common and required ones.

This action will take 4 inputs: project, issue type, summary and description. Project, issue type and summary will be required inputs, description will be optional.

  1. Add a new input: project. Select single select input type and update its label and ID on the right panel. Enable Mandatory option.

  2. Add another input: issueType. Select single select input type and update its label and ID on the right panel. Enable Mandatory option.

  3. Add another input: summary. Select text input type and update its label and ID on the right panel. Enable Mandatory option.

  4. Add the last input: description. Select text input type and update its label and ID on the right panel.

Step 5: Create your requests

We'll start with generating sources for the select components.

Generating sources for project input through List Projects request

The options of project input will be the list of projects in your Jira instance. We can get the list of projects from Jira REST API.

  1. Add a new API request. Name it ListProjects.

  2. Select Jira connection.

  3. Enter /rest/api/3/project/search as the endpoint.

  4. Run your request.

  5. Navigate to source field of project input on Inputs tab and enter below in display and identifier fields.

Display: {{request.GetProjects.response.body.values.map(p=>p.name)}}
Identifier: {{request.GetProjects.response.body.values.map(p=>p.id)}}

Generating sources for issueType input through List Issue Types request

The options of issueType input will be the list of issue types in the selected project. We can get the list of issue types from Jira REST API.

  1. Add a new API request. Name it ListIssueTypes.

  2. Select Jira connection.

  3. Enter /rest/api/3/issuetype/project as the endpoint.

  4. Enter a new parameter projectId. Enter {{input.project}} as its value

  5. Run your request.

  6. Navigate to source field of project input on Inputs tab and enter below in display and identifier fields.

Display: {{request.GetIssueTypes.response.body.map(t=>t.name)}}
Identifier: {{request.GetIssueTypes.response.body.map(t=>t.id)}}

API request to create an issue in Jira

  1. Add a new API request. Name it CreateIssue.

  2. Select Jira connection.

  3. Select POST method.

  4. Enter /rest/api/3/issue as the endpoint.

  5. Enter below in raw body field.

{
"fields": {
"summary": "{{input.summary}}",
"issuetype": {
"id": "{{input.issueType}}"
},
"project": {
"id": "{{input.project}}"
},
"description": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"text": "{{input.description}}",
"type": "text"
}
]
}
]
}
}
}

Step 6: Run button and run steps

When all requests are ready, next step is to specify which ones will be executed when the action is run.

  1. On Inputs tab, navigate to Run button. Once you select this button, you can change its label and specify the requests that will be executed to run this action.

  2. Change its label to Create.

  3. Add CreateIssue request in run steps.

Info

Note that there is no need to add the requests that are used to generate values for inputs. These requests will be triggered when a user calls Actioner app in Slack and navigates to this action. Requests added to run steps are the ones that will be sent when the user clicks run button, such as Create Issue API request while creating a new issue in your Jira project.

Step 7: Create your outputs

In Actioner, outputs are the results of actions. They can be in various visual forms, such as tables, charts, or informational text.

This will generate only one output: a markdown text showing that the issue is created successfully.

  1. On Outputs tab, add a new output. Select Markdown /text option from the list.

  2. On the right panel, enter Result in Title field.

  3. Add a block. Select markdown.

Info

On markdown blocks, you can use markdown styling and dynamically reference to your action's components inside double curlies - {{ }}.

  1. Enter below on markdown field:
### Issue is created successfully

**Issue key**: {{request.CreateIssue.response.body.key}}

Step 8: Test your action

To test your action, you can use the components on Inputs tab as a form outlay.

  1. Go to Inputs tab and enter values to Project, Issue type, Summary and Description fields.

  2. Click Test action button. It automatically switches to Outputs tab, where you can see the results and continue to work on your action if needed.

Step 9: Apply changes to your action

When your action is ready to be run, you can apply your changes, or revert them and save the action without your progress and delete your draft.

  1. Click Apply changes button at top right corner. This will save the action with all the progress.

  2. Do not forget to enable your action to make it available to be run in Slack.

Step 10: Run your action in Slack

  1. In Slack, type Actioner in shortcuts menu and start typing the name of your action.

  2. Enter parameters on the opening screen.Select a project, the issue type, enter the issue summary and description. When all is set, run your action.

  3. When you run the action, you'll get the result in markdown output format. You can share the result with your colleagues in your preferred channel by adding your notes.