Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,457,706
Community Members
 
Community Events
176
Community Groups

Can I create issue link to External Jira Project site using Jira API Cloud?

Hi,

 

I'm trying to create issue link to external Jira Project site but the status is status: 404 - Not Found

This my code, I'm create this code in 1st Jira Site Project using script runner console and the link issue destination is 2nd Jira site Project

This my script, please correct my script if there anything wrong with my this

 

import groovy.json.JsonOutput

final externalUrl = "https://my-2ndJIRA-site.atlassian.net"

def body = JsonOutput.toJson(["outwardIssue": ["key": "PERF-1"],
"comment": [
"visibility": [
"type": "group",
"value": "jira-software-users"
],
"body": [
"type": "doc",
"version": 1,
"content": [
"type": "paragraph",
"content": [
[
"text": "Linked related issue!",
"type": "text"
]
]
]
]
],
"inwardIssue": ["key": "SA-2"],
"type": ["name": "Duplicate"]
])

def postResponse = post(externalUrl, "/rest/api/3/issueLink", body)

def post(def hostUrl, def endpointAndQuery, def bodyJson) {
post("$hostUrl$endpointAndQuery")

.header('Authorization', "Basic ${'my-email.com:my-API-token'.bytes.encodeBase64()}")
.header('Accept', 'application/JSON')
.header('Content-Type', 'application/json')
.body(bodyJson)
.asObject(Map)
.body
}

and the error message is

POST request to https://my-2ndJIRA-site.atlassian.net/rest/api/3/issueLink returned an error code: status: 404 - Not Found
body: {errorMessages=[Issue does not exist or you do not have permission to see it.], errors={}}

 

I'm sure this not issue with permission in Jira because I can create link issue manually in the both site (with the same user in API).

Please give me an advices.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events