Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,366,432
Community Members
 
Community Events
168
Community Groups

How to identify the id when calling the zapi service

We are using Zephry Cloud with Zapi plugin.

I am trying to call the below service, but i am not sure how should I get the <id> ; I just have the "key": "PROJ-123"

https://jira.autodesk.com/rest/zapi/latest/execution/{id}/execute

2 answers

@Arun Ravindran Hi,

I have been trying hard to settle on things regarding ZAPI but fortunately found this thread where I saw a hope of getting some query answered. Thanks for the sequence you have explained above. I am trying to follow them but for some reason I get below error while making ZAPI calls (JIRA api calls work fine - eg <JIRA_SERVER>/rest/api/2/search?jql=project="Your Project Key")

"Sorry, we had some technical problems during your last operation.
Request assistance
Copy the content below and send it to your JIRA Administrator

Technical details
Log's referral number: a63e859c-aacb-4c6e-8d5b-f6945a8a86b6
Cause
Referer URL: Unknown
java.lang.NullPointerException"

Steps I followed:

1. Made a request http://<JIRA>/rest/api/2/issue/{Story ID}

2. I got all the test cases Id, but i could see multiple ids for an item such as 

      "outwardIssue": {
                "id": "333095",
                 "key": "AI-188",

      {
           "id": "166691",
            "self": "https://<JIRA>/rest/api/2/issueLink/166691",
           "type": {
            "id": "10240",
          "name": "Blocker",

    I don't know which Id should I refer to make a ZAPI call in the subsequent calls

 

3. If I take one of the id and fire a request as http://<JIRA>/rest/zapi/latest/execution/333095/execute

I get the above error "Sorry, we had some technical problems during your last operation.

Please let me know what I am missing. I have been struggling to get this working from the past week. Need good resource. Thanks in advance

Hi Abin

Thanks for your interest in Zephyr.

You can fetch the correct execution ID by performing the following steps

  1. Retrieve all the issues of project using the JIRA Rest API. The below call should help: GET <JIRA_SERVER>/rest/api/2/search?jql=project="Your Project Key"

This should get all the issues for a given project. You can then compare the "summary" response returned with the names in your file. You can also get the Issue ID with the same call.

  1. Now use this issue id to retrieve all the executions using ZAPI.
    GET <JIRA_SERVER>/rest/zapi/latest/execution?issueId=

  2. Use the execution Id to either create a new execution or update an existing execution.

a. Create a new execution:
POST <JIRA_SERVER>/rest/zapi/latest/execution
b. Update an existing execution:
PUT <JIRA_SERVER>/rest/zapi/latest/execution/{id}/execute

Let us know if you have any queries about the above mentioned.

Thanks

ZephyrSupport

Hola Arun, estoy realizando lo indicado en el paso 1 que indicas anteriormente, pero alli se esta rompiendo generando error: 401- AUTHENTICATED_FAILED, yo estoy utilizando JIRA SERVER, con ZEPHYR (ZAPI)

 

HttpResponseProxy{HTTP/1.1 401 [Date: Wed, 14 Oct 2020 19:27:40 GMT, Content-Type: text/html;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, Set-Cookie: AWSALB=ZYqgcOnWFdJUGChHE6J3otXJ/JbHOiLTEi0pm2C5mf/dX7y0P0Lw9W9oyt3LVrGrLUetfhvzMnCjMS15ZAhhYW/vFn9KRZsJQdetU+903xbY+pynk+uhSx3xiVeC; Expires=Wed, 21 Oct 2020 19:27:40 GMT; Path=/, Set-Cookie: AWSALBCORS=ZYqgcOnWFdJUGChHE6J3otXJ/JbHOiLTEi0pm2C5mf/dX7y0P0Lw9W9oyt3LVrGrLUetfhvzMnCjMS15ZAhhYW/vFn9KRZsJQdetU+903xbY+pynk+uhSx3xiVeC; Expires=Wed, 21 Oct 2020 19:27:40 GMT; Path=/; SameSite=None, X-AREQUESTID: 1167x106115x1, X-ANODEID: i-0abe64de1debb5e08, X-XSS-Protection: 1; mode=block, X-Content-Type-Options: nosniff, X-Frame-Options: SAMEORIGIN, Content-Security-Policy: frame-ancestors 'self', X-ASEN: SEN-16534229, X-Seraph-LoginReason: AUTHENTICATED_FAILED, WWW-Authenticate: OAuth realm="http%3A%2F%2Fjira.XXXXXXXXXX.com", Set-Cookie: JSESSIONID=7C406C423C3F7A63B2E32A28F599B4A5; Path=/; HttpOnly]}

Hi can you share the post body example?

a. Create a new execution:
POST <JIRA_SERVER>/rest/zapi/latest/execution

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events