Jira Automation Rule to Publish to PubSub

64 Views Asked by At

I am working on using Jira Automation to send issue updates to Google PubSub. However, I am facing challenges with the message format required by PubSub, which involves using a Json Object with a messages array, containing an array of data elements that need to be base64 encoded. I have created a custom data format that matches this requirement, but it involves specifying the fields one by one.

{
  "messages": [
  {
    "data": "{{#base64Encode}}
      {"key": "{{issue.key}}",
      "project": "{{issue.project.key}}",
      "status": "{{issue.status.name}}",
      "summary": "{{issue.summary}}",
      "description": "{{issue.description}}",
      "priority": "{{issue.priority.name}}",
      "issuetype": "{{issue.issuetype.name}}",
      "creator": "{{issue.creator.emailAddress}}",
      "reporter": "{{issue.reporter.emailAddress}}",
      "assignee": "{{issue.assignee.emailAddress}}",
      "created": "{{issue.created}}",
      "updated": "{{issue.updated}}",
      "issue_links": "{{issue.issuelinks.id}}"
      }
    {{/base64Encode}}"
  }
  ]
}

Is there a way to access the entire issue body in JSON format and base64 encode it without making an extra REST call to the JIRA API? I want to utilize the issue smart value itself to access this data. Any suggestions or solutions would be greatly appreciated. Thank you!

I tried accessing the fields one by one but this does not match my requirements as I have to read the whole issue data including custom_fields which cannot be know in advance.

1

There are 1 best solutions below

0
On