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

How to create a Epic and a Story using JIRA REST Json

Egbert Jansen June 24, 2015

Hi,

We are using JIRA REST to add issues, stories and epics to JIRA.

I'am able to add Issues to JIRA, but not stories and epics.

String for creating issues is:
"{\"fields\": {\"project\":{ \"key\": \"TEST\" }, \"summary\": \"REST 01.\", \"description\": \"Creating of an issue\", \"issuetype\": { \"name\": \"Bug\"} } }"

Who has some examples for creating stories and epics? 

Thanks,
Egbert 

4 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

4 votes
Answer accepted
Egbert Jansen June 30, 2015

Hi guys, thanks for the answers.

I've used the following json strings and they work fine for me:

Create a Story:
{"fields":{"project":{"key": "TEST"},"summary": "Story01","description": "Create a Story via REST","issuetype": {"name": "Story"}}} 

Create an Epic:
{"fields":{"project":{"key": "TEST"},"customfield_10401": "Epic Name 01","summary": "REST EXAMPLE1","description": "Creating an Epic via REST","issuetype": {"name": "Epic"}}}

customfield_10401 can be different on another JIRA installation.

G Mani December 9, 2018

Hi Egbert ,

 

""" Create an Epic:
{"fields":{"project":{"key": "TEST"},"customfield_10401": "Epic Name 01","summary": "REST EXAMPLE1","description": "Creating an Epic via REST","issuetype": {"name": "Epic"}}}"""

 

Nice of Creating an epic but i have a doubt that i need to create a story to which epic i have created in epic with epic link.

 

epic link is required to create a story in which we have created the epic.

 

Thank u.

 

please rly fast...

AhmadElkenany February 5, 2019

Is the (customfield_10401) static ? 

1 vote
I April 15, 2019

I created an issue and linked to the right epic by following below query

dataToPost='{"fields": {"project": {"key": "WDP1234"}, "summary":"REST ye merry gentlemen.", "description":"Creating of an issue using project keys and issue type names u", "issuetype":{"name": "Task"}, "customfield_10001": "WDPUIQC-1"}}'

## customfield_10001 is my epic id
## printf '%s\n' "$dataToPost"

issue=$(curl -D- -kv -u charlie:charlie \
-X POST -H "X-Atlassian-Token: nocheck" --data "$dataToPost" \
-H "Content-Type: application/json" \
https://jira.hostname.com.au/rest/api/2/issue/
)

echo "$issue"
0 votes
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.
June 24, 2015

Best guess is that you don't have "bug" or "story" as issue types in the target project.  Check the issue type scheme.

0 votes
Volodymyr Krupach
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 24, 2015

Hi Egbert,

Please try to pass id of issuetype:

"issuetype": {
            "id": "10000"
        },

you can get full list of available issuetypes via /rest/api/2/issuetype

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events