You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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.