jira automation web request: Invalid url in "self" field of issue payload

Anton Fedorov April 27, 2022

Hello!

 

I have a jira automation for issues, which uses web request action. I'm trying to send HTTP request to my endpoint with web request body in jira automation format, which looks like this:

{
"self": "https://sportsru.atlassian.net/rest/api/2/92165",
"id": 92165,
"key": "SF-2876",
// ...
}

The problem that is url provided in self are not valid: it's missing part about issue. The valid one should look like this:

https://sportsru.atlassian.net/rest/api/2/issue/92165

However, when I'm validating request via automation editor, I receiving payload with correct url.

Is this a bug or am I doing something wrong?

 

1 answer

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 27, 2022

Hi Anton,

You seem to be trying to call the Jira REST API from an automation rule. 

If that is correct, please take a look at this how-to article for calling the REST API from a rule:

https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828

And, please confirm you are calling the REST API function with the correct parameters/URL:

https://docs.atlassian.com/software/jira/docs/api/REST/1000.824.0/#api/2/issue-getIssue

Kind regards,
Bill

Anton Fedorov April 28, 2022

Hello Bill, thanks for the answer!

 

I'm sorry, seems like I inaccurately described the problem, what you are recommending to me is not quite what I'm looking for.

What I have Is Automation action called  "Web request", which is making a HTTP request to my endpoint with issue data in Jira automation format as payload. Then, in my endpoint I'm expecting that received payload will contain a field called self, which should contain Jira REST API url to the issue. The problem is that provided url in self field is incorrect and points to the 404 page instead of issue.

In other words, I expect this url in payload:

https://sportsru.atlassian.net/rest/api/2/issue/92165

but instead I receiving this:

https://sportsru.atlassian.net/rest/api/2/92165

 The issue part of the path is missing.

 

Hope this explanation will make my problem more clear!

Like moisesnessim likes this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 28, 2022

Thanks for clarifying, Anton.

I suggest trying to diagnose this from one end to the other...

  • start by calling your request from a browser or other tool to confirm it returns what is expected
    • if it does not work: investigate your endpoint
    • if it does, proceed...
  • next try calling a different endpoint from the same automation for Jira rule, web request action
    • if it does not work: investigate any issues with the calling token setup
    • if it does, proceed...
  • next try calling your endpoint again, and examine the response structure
    • it is possible it may not be structured as you expect
    • if it is structured correctly, and yet missing the expected data, work with your site admin to submit a ticket to the Atlassian Support team for advice: https://support.atlassian.com/contact/#/

Suggest an answer

Log in or Sign up to answer