How to Use Pipedream API to Update JIRA Case from Freshdesk Cases Data?

This topic was automatically generated from Slack. You can find the original thread here.

Am I in the right place for assistance with pipedream api questions?
I would like to cycle through all my Freshdesk Cases and using the ID, update a JIRA case (where the FD ID is in a bespoke field). The idea is to add the FD Resolved Date to a bespoke Jira field.
Looking for some assistance on how to build that.

Hi, I think your question is a great case for Pipedream bot to help. I’ll pass your question to the Pipedream bot now. Please feel free to ask it any question

I would like to cycle through all my Freshdesk Cases and using the ID, update a JIRA case (where the FD ID is in a bespoke field). The idea is to add the FD Resolved Date to a bespoke Jira field.

To achieve this, you can use the Freshdesk “List All Tickets” action and the Jira “Update Issue” action in a Pipedream workflow. Here’s a step-by-step guide: 1. Create a new workflow in Pipedream. 2. Add a Freshdesk “List All Tickets” action: - Search for the Freshdesk app from the step menu. - Select the “List All Tickets” action. - Connect your Freshdesk account. - Test the action to ensure it’s working. 3. Add a “Loop Over Items” action to iterate over the tickets: - Set the “items” field to steps.freshdesk_list_all_tickets.$return_value. 4. Inside the loop, add a Jira “Update Issue” action: - Search for the Jira app from the step menu. - Select the “Update Issue” action. - Connect your Jira account. - Set the “Cloud ID” and “Issue id or key” fields based on your Jira configuration. - In the “Update” field, set the bespoke Jira field with the Freshdesk Resolved Date (you can access the resolved date using steps.loop_over_items.item.resolved_at). Remember to replace the placeholders with the actual field names and values specific to your use case. After setting up the workflow, you can run it to update your Jira cases with the Freshdesk Resolved Date.

It’s not clear from the demos that this is actually achieving what I need.

I think this need a sufficient coding knowledge to implement. If you’re still unsure that you can implement your usecase, you can:

  1. Read more about Pipedream Node.js document here and watch Pipedream University series to understand how Pipedream works
  2. Read more about Javascript, especially Node.js part. Also you can watch through Pipedream speedrun series to have more references
  3. If you have subscribed to Pipedream Business plan, you will be added to a dedicated slack support channel
  4. If you’d like to hire a Pipedream expert for your usecase, feel free to use this link: Connect with a Pipedream Partner

where did you get the information about “Loop Over Items” action?

I apologize for the confusion earlier. It seems I made an error in my response. There isn’t a “Loop Over Items” action in Pipedream. Instead, you can use a code step to iterate over the tickets and update the JIRA cases. Here’s a revised version of the workflow: 1. Create a new workflow in Pipedream. 2. Add a Freshdesk “List All Tickets” action. 3. Add a code step to iterate over the tickets and update the JIRA cases: ```
const freshdeskTickets = steps.freshdesk_list_all_tickets.$return_value; for (const ticket of freshdeskTickets) { const fdId = ticket.id; const resolvedDate = ticket.resolved_at; // Find the JIRA case with the matching Freshdesk ID in the bespoke field // You’ll need to replace “customfield_XXXXX” with the actual custom field ID // and adjust the JQL query as needed. const jql = customfield_XXXXX = "${fdId}"; const jiraIssues = await steps.jira_search_issues.run({ jql }); if (jiraIssues.issues.length > 0) { const jiraIssue = jiraIssues.issues[0]; const issueId = jiraIssue.id; // Update the bespoke Jira field with the Freshdesk Resolved Date // Replace “customfield_YYYYY” with the actual custom field ID for the resolved date await steps.jira_update_issue.run({ issueId, update: { customfield_YYYYY: [{ set: resolvedDate }], }, }); } }