Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

Not able to link an epic to issue via rest api

I am able to create the issue successfully  but Epic Link which is a custom field is not set

api : https://track-api.com/jira/rest/api/2/issue

issue Post Data

 

{'fields': {'summary': 'summary', 'issuetype': {'self': 'https://track-api.com/jira/rest/api/2/issuetype/12200', 'id': '12200', 'description': '', 'name': 'Service Entitlement', 'subtask': False, 'avatarId': 17100}, 'customfield_17002': {'self': 'https://track-api.com/jira/rest/api/2/customFieldOption/18265', 'value': 'False', 'id': '18265'}, 'description': 'decription', 'project': {'self': 'https://track-api.com/jira/rest/api/2/project/25400', 'id': '25400', 'key': 'TESTPREM3', 'name': 'Test Premium3 Premium Health check', 'customfield_16900': {'self': 'https://track-api.com/jira/rest/api/2/customFieldOption/18260', 'value': 'Premium 3.0', 'id': '18260'}, 'customfield_10903': 'TESTPREM3-126'}}

 

customfield_10903( Epic Link)

 

 

2 answers

3 votes

You should use Jira software API for it POST /rest/agile/1.0/epic/{epicIdOrKey}/issue. You can find more info here:

https://docs.atlassian.com/jira-software/REST/7.3.1/#agile/1.0/epic-moveIssuesToEpic

Tarun Sapra Community Leader May 29, 2018

Thanks @Alexey Matveev _cPrime_ for sharing this, I am a bit surprised that setting the epic link is not supported via normal REST API (fields element updating custom field) as there is not much info about it based on the error here -https://jira.atlassian.com/browse/JSWSERVER-7017 

0 votes
Tarun Sapra Community Leader May 29, 2018

Hello @nik1989

What is the error you see in the response, is the issue created successfully but without the epic link?

@Tarun Saprayes , issue is created successfully , epic is not linked

Tarun Sapra Community Leader May 29, 2018

Is the epic link field available on the edit screen.

yes the epic link is available on edit screen.

Tarun Sapra Community Leader May 29, 2018

Strange, could you try doing it on the PUT request as shared by @Alexey Matveev _cPrime_ , thus once the issue is created then in the response you should have the issue key and then do a PUT request to update epic link.

tried that , but response is 404

 

url : https://track-api.com/rest/agile/1.0/epic/TESTPREM3-126/issue

data: {'issues': ['TESTPREM3-133']}

Tarun Sapra Community Leader May 29, 2018

404 means - Returned if the epic does not exist or the user does not have permission to view it.

But that doesn't seem to be the case in your scenario as it's the same project. Your request was Put or POST?

The epic exists as i am able to see it on ui , i made a post request as the document says.

Tarun Sapra Community Leader May 29, 2018

What's your rest client, could you try the request with couple of different REST clients and see if the error is same, as it could be that you are running into a bug and might need to reach out to Atlassian support.

Hi 
I am also getting same error 404.
my URL is https://jira2.cerner.com/rest/api/2/epic/DEVACDMY-14837/issue

and data is :

{
"fields":{
"summary":"Summary",
"issuetype":{
"name":"Story"
},
"project":{
"key":"DEVACDMY"
},
"description":"Creating the jira for testing"
}
}

And I am using postman for raising the request

 

Please help me 

Thank You 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

ThinkTilt is joining the Atlassian Family!

This morning, Atlassian announced the acquisition of ThinkTilt , the maker of ProForma, a no-code/low code form builder with 700+ customers worldwide. ThinkTilt helps IT empower any team in their or...

193 views 11 13
Read article

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