This Jira Automation rule will show you how to create a custom field on an Issue and allocate a LaunchNotes attribute to it, based on that field value. In this example, we're going to use a "bug" Issue in Jira with two different fields that will match to different categories on an announcement in LaunchNotes depending on their value.

This rule will also be leveraging the Associating Jira Issues to LaunchNotes Categories rule, which allocates a specific aategory to an announcement in LaunchNotes depending on which Issue type is created in Jira. This will result in two categories being associated with the one announcement: One for the Issue Type, and the second for the Field value.

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

  1. Your project ID

  2. Your management API token

  3. Your Category ID's


First, we're going to create the context field on the issue type that we'll reference in our rule to associate a different attribute to based on the value. In Jira, head to Project settings > Issue types > and select which issue you'd like to add the Context fields to.

In this example, we're going to create a field called LaunchNotes Audience, and have two different options in a dropdown menu: "Internal & External", and "Internal".

Now that this field is set on the Jira Issue, we're going to create the rule:

Rule Setup

Go to Project Settings > Apps > Project automation > Rules > Create rule:

  • When: Issue Transitioned

    • From Status: (Blank)

    • To: Done

Issue Fields Condition

  • Field: Issue Type

  • Condition: Equals

  • Value: Bug

Branch: For Current issue

  • Issue Fields Condition:

    • Field: LaunchNotes Audience

    • Condition: Equals

    • Value: Internal

  • 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!,$categoryAudienceID: ID!){createAnnouncement(input: {announcement: {projectId: $projectId,headline: $headline,contentJira: $contentJira,categories: [{ id: $categoryID }, { id: $categoryAudienceID}]}}) {announcement {id}}}",
  "variables": {
    "projectId": "YOUR_PROJECT_ID",
  "headline": "{{issue.key}} - {{issue.summary}}",
  "contentJira": "{{issue.description.jsonEncode}}",
  "categoryID": "YOUR_ISSUE_TYPE_CAREGORY",
  "categoryAudienceID": "YOUR_CUSTOM_FIELD_CATEGORY"
 }
}

Then

  • New Action: Send web request

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

Repeat this with another branch and to reference the Category you'd like to use for the other fields ("Internal & External" in this example).

Save this out and Validate your web request configuration, and you should now see your Announcements created with the two Categories on your LaunchNotes account:

Did this answer your question?