This automation rule will allow you to create an Announcement in LaunchNotes by creating an Issue in Jira, and associate a specific category/categories to the Announcement based on the Jira Issue type.

At this time, Jira Automation does not support multiple branches on the rule to allow for associating more than one Issue Type to respective different categories, therefore a unique rule to associate an Issue Type to a specific LaunchNotes category will have to be created for each one.

In order to set this up in Jira, you'll need the following information from your LaunchNotes account:


In this example, we're going to be using the Issue Type = Bug, and correspond this to a LaunchNotes category named "Bug".

First, we're going to identify which Issue Type you'd like to associate to a Category.

Under Project Settings > Apps > Project Automation in Jira, Create new rule:

  • When: Issue transitioned

    • to: Done

  • Issue fields condition

    • Field: Issue Type

    • Condition: Equals

    • Value: Bug

  • New Action: Send web request

    • Webhook URL: https://app.launchnotes.io/graphql

    • Headers:

      • Authorization

      • Bearer (your_management_api_key)

    • HTTP Method: Post

    • Web request body: Custom Data

    • Wait for response ✅ "Delay execution of subsequent rule actions until we've received a response for this webhook"

    • Custom Data:

      {
      "query": "mutation createAnnouncement ($projectId: ID!,$headline: String!,$contentJira: String!,$categoryID: ID!){createAnnouncement(input: {announcement: {projectId: $projectId,headline: $headline,contentJira: $contentJira,categories: [{ id: $categoryID }]}}) {announcement {id}}}",
      "variables": {
      "projectId": "YOUR_PROJECT_ID",
      "headline": "{{issue.key}} - {{issue.summary}}",
      "contentJira": "{{issue.description.jsonEncode}}",
      "categoryID": "YOUR_CATEGORY_ID"
      }
      }

💡 You can get creative with the headline - the example used in the snippet above

is an example of how we use this at LaunchNotes.

The above will create a draft announcement, and now we're going to add in the second stage to this rule; publishing the announcement:

To do this, we're going to call a second mutation to publish the Announcement by pulling in the previous API request to make this request to publish.

Continue building out this rule by adding a component under the Web request action:

  • New Action: Send web request

{
"query": "mutation publishAnnnouncement ($id: ID!) {publishAnnouncement(input:{announcementId:$id}){announcement{id}}}",
"variables": {
"id": "{{webhookResponse.body.data.createAnnouncement.announcement.id}}"
}
}

Did this answer your question?