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,556,650
Community Members
 
Community Events
184
Community Groups

Always getting message "Specify a valid project ID or key" can i create the issue with free version?

This is my code

# -*- coding: utf-8 -*-
"""
Created on Wed Jan 5 22:39:01 2022

@author: 10077269
"""

# This code sample uses the 'requests' library:
# http://docs.python-requests.org
import requests
from requests.auth import HTTPBasicAuth
import json

url = "https://your-domain.atlassian.net/rest/api/3/issue"

auth = HTTPBasicAuth("xxxxx", "xxxxx")

headers = {
"Accept": "application/json",
"Content-Type": "application/json",
'X-Atlassian-Token': 'no-check'
}

payload = json.dumps( {
"update": {},
"fields": {
"summary": "Main order flow broken",
"parent": {
"key": "AT"
},
"issuetype": {
"id": "10001"
},
"components": [
{
"id": "10001"
}
],
"customfield_20000": "06/Jul/19 3:25 PM",
"customfield_40000": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"text": "Occurs on all orders",
"type": "text"
}
]
}
]
},
"customfield_70000": [
"jira-administrators",
"jira-software-users"
],
"project": {
"id": "101"
},
"description": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"text": "Order entry fails when selecting supplier.",
"type": "text"
}
]
}
]
},
"reporter": {
"id": "5b10a2844c20165700ede21g"
},
"fixVersions": [
{
"id": "10001"
}
],
"customfield_10000": "09/Jun/21",
"priority": {
"id": "20000"
},
"labels": [
"bugfix",
"blitz_test"
],
"timetracking": {
"remainingEstimate": "5",
"originalEstimate": "10"
},
"customfield_30000": [
"10000",
"10002"
],
"customfield_80000": {
"value": "red"
},
"security": {
"id": "10000"
},
"environment": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"text": "UAT",
"type": "text"
}
]
}
]
},
"versions": [
{
"id": "10000"
}
],
"duedate": "2019-05-11",
"customfield_60000": "jira-software-users",
"customfield_50000": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"text": "Could impact day-to-day work.",
"type": "text"
}
]
}
]
},
"assignee": {
"id": "5b109f2e9729b51b54dc274d"
}
}
} )

response = requests.request(
"POST",
url,
data=payload,
headers=headers,
auth=auth
)
print(response.status_code)
print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))

1 answer

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 05, 2022

What is the "Key = AT" in your data supposed to be?

At a glance, it looks like you are trying to create a sub-task of another issue, in which case, you need to specify which issue the sub-task is a part of.  That means giving it the full key of the parent, not just the project key.

If you're just trying to create an issue, and not a sub-task, then you don't need a parent section.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events