I’m currently setting up a Zap to post comments from Jira Service Desk / Jira Service Management to a Zendesk ticket when the Jira Request is updated.
This was working pretty good! A zap first creates the request from Zendesk in Jira Service Desk and stores the Zendesk ticket ID in the request. Then when the request is updated in Jira, it updates the Zendesk ticket with the Jira Request Status and the comment.
But then I tried adding more than one comment to the Jira Request.
Instead of grabbing the most recent comment from Jira, it grabs ALL the comments on the request. Oops! From what I can tell, when using the field that would contain the text of the comment, Zapier is grabbing every instance of that field in the array that’s returned from Jira.
Does anyone have any insight on how to grab just the last item (most recent comment) from the array returned by Jira? Thanks!
Â
The zap is currently set up as follows:
- Trigger: Updated Request in Jira Service Desk
- App: Jira Service Desk
- Trigger Event: Updated Request
- Jira Service Desk account: our sandbox account (always test first!)
- Site: our sandbox site
- Project: our test project
- Action: Only continue if…
- App: Filter by Zapier
- Filter setup & testing: Only continue if…
- Fields Customfield <ID>: Exists
<ID> being the actual custom field ID from Jira that contains the Zendesk Ticket ID.
- Fields Customfield <ID>: Exists
- Action: Update Ticket in Zendesk
- App: Zendesk
- Action Event: Update Ticket
- Set up action
- Ticket: sFields Customfield <ID>]
<ID> being the actual custom field ID from Jira that contains the Zendesk Ticket ID. - New Status: Open
- New Comment To Add To The Ticket
Ticket Updated in Jira Service Desk with the following comment:
<1. Fields Comment Comments Body Content Content Text] - Should The First Comment be Public?: No
- Jira Service Desk Request Status: sFields Status Name]
- Ticket: sFields Customfield <ID>]
And here’s an example of the output from the testing of the Jira trigger. (I’ve removed a lot of details that aren’t relevant to this issue.)
fields
   ...
   comment:
      comments:
         1:
            self: https://api.atlassian.com/ex/jira/<UUID>/rest/api/3/issue/<ID>/comment/<ID>
         id: <ID>
         …
         body:
            version: 1
            type: doc
            content:Â
               1:
                  type: paragraph
                  content:
                     1:
                        type: text
                        text: Testing an internal note to update this ticket.
         ...
         created: 2021-03-04T12:01:19.878-0600
         updated: 2021-03-04T12:01:19.878-0600
         jsdPublic: false
      self: https://api.atlassian.com/ex/jira/<UUID>/rest/api/3/issue/<ID>/comment
      maxResults: 1
      total: 1
      startAt: 0
   ...
originalId: <ID>
Â