Need Login Api for 3rd party Application where i can use Jira Username and password and receive cloud session token

I was using Jira apis in my 3rd party application and able to add create issue, add testcases, and update that testcases status also but now login service is changes to Microsoft login and Now my apis are not working. Can any one suggest me any solution for this.

  1. If possible can we use Microsoft Login Apis
  2. Other how i can create cloud session token

Hi @Apeksha , welcome to the developer community!

If you are using the Jira API via Basic Auth with your login, we recommend generating tokens, and not use your password directly. You can generate a token here: Atlassian account and use it in place of your password in REST API requests.

Hi @mventnor i am able to login with Api token but after that I am trying to get event by curl and tried code in node also but not able to get result The Jira Cloud platform REST API (atlassian.com) I am referring this link, am I correct ?

Hi @mventnor able to create ‘Text Execution’ by using

var response = await axios.post(
            'https://your-domain.atlassian.net/rest/api/2/issue',
        
            {
              'fields': {
                'project': {
                    'key': 'PROJECTKEY'
                },
                'summary': 'Test Ticket using API 2 Apeksha_1',
                'description': 'Test description',
                'issuetype': {
                  'name': 'Test Execution'
                }
              }
            },
            {
              headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json'
              },
              auth: {
                username: 'username@username.com',
                password: 'API TOKEN'
              }
            }
          )

but not with ‘https://your-domain.atlassian.net/rest/api/3/issue’ now i want to add already created Test in this card how should i do that?

Can you suggest me something
Thanks In Advance

Hi @Apeksha ,

Did you change your request body to reflect any differences in the v2 and v3 APIs? For example, the description in the v3 API is an ADF object, not a string. Please refer to: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-post

1 Like

HI @mventnor ,

I tried for below api but got response as 400 can you try from your end and let me know

var response = await axios.post(
https://your-domain.atlassian.net/rest/api/3/issue’,

        {
          'fields': {
            'project': {
                'id':'projectId'
            },
            'summary': 'Test Ticket using API 2 Apeksha_1',
            'description': 'Test description',
            'issuetype': {
              'id':'10009'
            }
          }
        },
        {
          headers: {
            'Accept': 'application/json',
            'Content-Type': 'application/json'
          },
          auth: {
            username: 'username@username.com',
            password: 'API TOKEN'
          }
        }
      )