I cannot make Jira cloud with Zephyr and ZAPI work, really.

DeSpell April 4, 2020

Hello community. After spending hours and hours reading community answers, GitHub README's, you documentation, I decide to use this last resort in case I find an answer.

First of all sorry about my frustration, but setting up Jir+ZEP+ZAPI, it's really a nightmare, believe me. I will tell you my story.

First of all, spent hours clicking here and there trying to find my AccountID. Why don't you have a simple option to click and get my account ID? Finally I find an answer which following this notation: PASTE IN THE BROWSER: https://<username>.atlassian.net/rest/api/3/myself 

and you get a JSON object notation with the accountID, done with that. Anyway a second way is to click the upper left icon, then select People and finally click your username from the right panel. I intentionally writing down the instructions, to help many many other developers, because believe me, the instructions are vague and outdated.

In that point I believed that I had some kind of progress, but to access the ZAPI you also need the famous "JWT Token", oh my. After downloaded dozens of libraries and languages in JavaScript, Java and Python none of these seems to be working. Furthermore noone seems to clarify what tokens you need to use ? Do you use the ZAPI system token or something else ? I tried every combination and came up with nothing.

First I downloaded the Java jar file with dependencies found here https://github.com/zephyrdeveloper/zapi-cloud but when you try to run it you get "missing main function". Missing main function, from where? What I should do to run this? Why I should spend hours to set it up? 

After that I tried the python script, which I most familiar with from the same source. And came up that this is not working either. I get all the time "authorization 401 error". Maybe is the API keys ? Maybe something else? I don't know really. I am not even sure if the endpoint is the right one because I found dozens of these with "/1.0", "/2"/ and "/3" versions(?) I suppose.

Finally I came up with the JS script and tried to run with concerns and I was right. When you try to run this you get "Syntax error, unexpected token *" because of the "import * as JWT from "atlassian-jwt' even if you run "npm atlassian-jwt" before. I am using the wrong version of npm? Something else? Why I should spend hours and hours to find an answer and search from node versions and so? Is this normal? I have spent years of development and never see something like that.

So anyway, the finally answers are:

- How I can generate a JWT key?

- Which is the right endpoint to access ZAPI cloud functions?

- What API keys I should need?

I have already include the Zephyr and ZAPI addon in my cloud.

Hope someone out there will help, regards and forgive me but trust me, many of your documentations are outdated.

 

 

 

 

 

 

 

 

2 answers

1 accepted

2 votes
Answer accepted
jagadeesh madhura
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 6, 2020

- How I can generate a JWT key?

Pre-requisite

  • Install Zapi from market place ( Navigate to jira settings >> manage apps >> search for zapi >> install it>
  • Generate accesskey and secret key (Select any project >> Navigate to Zephyr >> Click on api keys >> Generate >> copy the access key and secret key )
  • Get the AccountId for the user to authenticate
    The easiest way I've found to find my accountId is to click on my icon on the sidebar and then on the "Profile" link. In the URL you can find your accountId after the last "/" :

https://********.atlassian.net/people/5bb7ad0ccc53fd0760103780

            or
just hit the url in browser
 https://********.atlassian.net/people /rest/api/3/myself

or for all user accountid

 https://********.atlassian.net//rest/api/3/users/search

How to generate JWT:

https://support.smartbear.com/kb/sample-create-jwt-token-for-a-zapi-cloud-api/

- Which is the right endpoint to access ZAPI cloud functions?

https://prod-api.zephyr4jiracloud.com/connect/

Refer document for all the api’s
https://zfjcloud.docs.apiary.io/#reference/attachment/get-teststep-attachment-list/creates-new-cycle

 

- What API keys I should need?
API key is not required for ZAPI
API key is required for zfj importer utility

API keys is only required to authenticate for jira api call’s, instead of username and password you have to provide username and apikey to authenticate jira call

To generate the api key >> Navigate to profile >> Manage your account  >>  Security >> api tokens
https://id.atlassian.com/manage-profile/security/api-tokens

 

How to use in postman

postman.png

 

If you are still facing issue with above steps contact zephyr support

https://support.smartbear.com/message/?prod=zephyr

Rushaal Maksane October 17, 2023

Hi Jagdeesh,

 

I am trying to create/fetch test step data using zapi api, i am not able to generate JWT, I am tired and exhausted from searching for the correct answer, can you please provide a proper working sample of JWT generation in c#. 

the link I am using to get the test step. Your help is greatly appreciated.

 

https://prod-api.zephyr4jiracloud.com/connect/public/rest/api/1.0/teststep/#####?projectId="###"

0 votes
Rushaal Maksane October 17, 2023

i totally agree, it is very frustrating and poor implementation of zapi API and documentation, why would you need a tool to generate JWT, it should have been simple straight forward documentation and implementation by open standard, which should easy and anyone can do it.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events