Best answer

Post an internal comment in Jira Service Project using API

  • 22 March 2024
  • 3 replies
  • 86 views

Badge

I am trying to post an internal comment to a jira service project issue using the API request event.
 

Depending on my setup, I either get the error: “Failed to create a http request in Jira Software Cloud
Raw request failed. Problem with your configured auth
” or the zap runs through but has empty headers and does not run successfully.   

 

Until now I have tried the custom action, the API request (beta), V2 and V3 API version, with additional request headers and without and different body inputs. 

 

With my latest setup, I am very close to solve the issue but somehow there is a problem. Can anyone help? 

 

According to this documentation “(https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-comments/#api-rest-api-3-issue-issueidorkey-comment-post), I need to set up two headers:

'Accept': 'application/json',
'Content-Type': 'application/json'

 

Zapier mentions, that auth headers will be added automatically, but whenever I test my zap the headers are empty (see txt-file below). 
 

When I add the "Accept" Key and Value “application/json”, the zap runs through with a 415 status and the header is not empty anymore. 
 

When I add the "Content-Type" there is an error: Failed to create a http request in Jira Software Cloud
Raw request failed. Problem with your configured auth. 

 

In my body i tried every option from the Documentation, from here: https://community.developer.atlassian.com/t/post-an-internal-comment-using-v3-api/59983/2 and here: https://community.atlassian.com/t5/Jira-Service-Management/Create-Internal-Comment-using-REST-API-for-Jira-Service-Desk/qaq-p/857385

 

App: Jira Software Cloud

  • Action Event: API Request
  • Set up action
    • HTTP Method: POST
    • URL:https://company.atlassian.net/rest/api/3/issue/{issueIdOrKey}/comment
    • Additional Request Headers
      Accept: application/json,
      Content-Type: application/json
    • Body: { "body": { "type": "doc", "version": 1, "content": [ { "type": "paragraph", "content": [ { "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget venenatis elit. Duis eu justo eget augue iaculis fermentum. Sed semper quam laoreet nisi egestas at posuere augue semper.", "type": "text" } ] } ] }, "properties": [ { "key": "sd.public.comment", "value": { "internal": true } } ] }'

 

Please help

 

 

 

icon

Best answer by JLO-up 26 March 2024, 21:30

View original

3 replies

Userlevel 7
Badge +14

Hi @JLO-up 

Check if there is a different Issue “ID” to use.

 

Badge

Hi @Troy Tessalone
thank you but I tried key and id - even without the variable. That is not the problem. I still get the error: 

 

Failed to create a http request in Jira Software Cloud (2.17.0)

Raw request failed. Problem with your configured auth:

Badge

In the meantime, I’ve found a different solution. Feel free to test it out, if you got a similar challenge.
 

Instead of the API request, I used the Webhook action and configured it like this: 

 

App: Webhook by Zapier

  • Action Event: Custom Request
  • Set up action
    • Method: POST
    • URL:https://company.atlassian.net/rest/api/3/issue/{issueIdOrKey}/comment
    • Data Pass-Through?: False
    • Data
      {
      "body": {
      "type": "doc",
      "version": 1,
      "content": [
      {
      "type": "paragraph",
      "content": [
      {
      "text": "Lorem ipsum",
      "type": "text"
      }
      ]
      }
      ]
      },
      "properties": [
      {
      "key": "sd.public.comment",
      "value": {
      "internal": true
      }
      }
      ]
      }

       

    • Unflatten: true
    • Basic Auth: Username | API-Token
    • Headers
      Accept: application/json,
      Content-Type: application/json

 

PS: I always received an error when I used a variable from a previous step in the text field. That is why I used a Format Replace text step for [:newline:]. 

Reply