There are two steps to publishing an Announcement through Jira - first we must create the Announcement, and once this is created, we can then publish the Announcement. We're using a Task in this example, but you can change this to whatever type of issue you'd like.

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

  1. Find your project ID

  2. Your LaunchNotes project management API token


We're going to create this rule in two stages, the first is creating the Announcement:

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: Task (this can be whatever issue type you'd prefer)

  • New Action: Send web request

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

  • Headers:

    • Authorization

    • Bearer (your_management_api_key)

    • HTTP Method: Post

    • Webhook 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!){createAnnouncement(input: {announcement: {projectId: $projectId,headline: $headline,contentJira: $contentJira}}) {announcement {id}}}",
"variables": {
"projectId": "YOUR_PROJECT_ID",
"headline": "{{issue.key}} - {{issue.summary}}",
"contentJira": "{{issue.description.jsonEncode}}"
}
}

💡 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

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

  • Headers:

    • Authorization

    • Bearer (your_management_api_key)

    • HTTP Method: Post

    • Webhook body: Custom Data

    • Custom Data:

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

❓ If you have any questions on our Jira integration, or would like suggest any changes to this help article please don't hesitate to get in touch with us at hey@launchnotes.io, or join us on live chat.

Did this answer your question?