It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Getting 404 error while accessing source /jira/rest/auth/1/session

Sagar I'm New Here Oct 03, 2019

While  doing cookie based authentication  with Jira getting 404 error while accessing resource "https://testhappiestminds.atlasJira Issue.pngsian.net/jira/rest/auth/1/session"

1 answer

0 votes
DPK J Community Leader Oct 03, 2019

@SagarThe resource you trying to access is removed from Jira Cloud in favor of API tokens, OAuth, or Atlassian Connect.

Here is deprecation/removal notice by Atlassian - https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-basic-auth-and-cookie-based-auth/

I suggest you to use basic authentication which is documented here - https://developer.atlassian.com/cloud/jira/platform/jira-rest-api-basic-authentication/

@DPK J 

Thanks for the information.

I was going through basic authentication documentation which was  referred by you and I found here also they are trying to access  resource "/rest/api/2/issue". Hence again, I am getting 404 error. Could you please help me here. Actually I wanted to create an issue in JIra using Api's which they have exposed.As we need to do authentication before we create issues, I am using above steps. 

DPK J Community Leader Oct 04, 2019

Below is sample bash file that you can use to create issue in Jira. Please replace,

  1. SITE_NAME with your site address i.e. https://testhappiestminds.atlassian.net
  2. EMAIL with your email
  3. API_TOKEN with API Token your might have generated
  4. PROJECT_KEY with key of project you want to create issue in
  5. ISSUE_SUMMARY with textual issue summary
  6. ISSUE_TYPE_NAME with name of issue type, like "Bug", "Task" etc.

 

Please save this as "sample.sh" and execute.

#!/bin/bash

curl --request POST \
--url 'https://testhappiestminds.atlassian.net/rest/api/3/issue' \
--user '<EMAIL>:<API_TOKEN>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"fields": {
"project": {
"key": "<PROJECT_KEY>"
},
"summary": "<ISSUE_SUMMARY>",
"issuetype": {
"name": "<ISSUE_TYPE_NAME>"
},
}
}'

 

Note - I have seen that you are adding 'jira' context path after site address before 'rest', this is not correct. API path for JIRA cloud is  'SITE_ADDRESS/rest/api/3/...'

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

314 views 1 3
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you