How to Send Complete Issue Data from Jira Automation to Google Cloud Pub/Sub

I’m trying to set up a Jira automation rule that pushes ticket information to Google Cloud Pub/Sub. The tricky part is that Pub/Sub expects messages in a specific JSON structure with base64 encoded content.

Right now I’m manually mapping each field like this:

{
  "messages": [
    {
      "data": "{{#base64Encode}}
        {"ticketId": "{{issue.key}}",
        "projectCode": "{{issue.project.key}}",
        "currentStatus": "{{issue.status.name}}",
        "title": "{{issue.summary}}",
        "details": "{{issue.description}}",
        "urgency": "{{issue.priority.name}}",
        "ticketType": "{{issue.issuetype.name}}",
        "createdBy": "{{issue.creator.emailAddress}}",
        "reportedBy": "{{issue.reporter.emailAddress}}",
        "assignedTo": "{{issue.assignee.emailAddress}}",
        "creationDate": "{{issue.created}}",
        "lastModified": "{{issue.updated}}",
        "linkedItems": "{{issue.issuelinks.id}}"
        }
      {{/base64Encode}}"
    }
  ]
}

The problem is I need to capture ALL issue data including custom fields that vary by project. Mapping everything manually is not practical since custom fields change depending on the setup.

Is there any smart value that gives me the complete issue object as JSON? I want to avoid making additional REST API calls if possible. Has anyone found a solution for this?

Nope, there’s no single smart value that dumps the whole issue as JSON. Hit this same wall 6 months ago setting up integrations across projects with different custom fields. I used {{issue}} for standard fields, but custom fields still need individual references like {{issue.customfield_XXXXX}}. The pain is knowing those field IDs upfront. Here’s what worked: I created a separate automation rule that logs all available smart values using {{issue.properties}} on a sample issue. This showed me which custom fields actually had data worth including. Also consider adding conditional logic to your JSON template - only include custom fields when they’ve got values. Otherwise you’ll spam your Pub/Sub with null entries. Makes the automation messier but way more reliable than grabbing everything blindly.

jira automation’s smart values won’t cut it for this. i set up a webhook to an intermediate service instead of hitting pub/sub directly. the webhook grabs the full jira payload (tons more data than smart values give you) and reformats it for pub/sub. more moving parts, but beats hunting down every custom field id.

I’ve dealt with this same issue in multi-project setups. Jira’s automation engine doesn’t give you a way to serialize complete issues through smart values - it’s frustrating. Here’s what worked for me: I built a field discovery script that checks each project’s config to find active custom fields, then creates project-specific automation templates. Not pretty, but it gets the job done. Another option - use the REST API’s expand parameter concept backwards. Create one master template with all possible custom fields in conditional blocks: {{#if issue.customfield_10001}}“customfield_10001”:“{{issue.customfield_10001}}”,{{/if}}. The automation skips empty fields automatically. You still need the field IDs upfront, but you can reuse the same template across projects without it breaking when fields don’t exist.