Rest API to create issue with epic link

Juan Leon October 26, 2021

Hi, I am trying to create a ticket and include the epic_link (customefield_1003) but I am getting error "cf_10003 cannot be set. it is not on the appropiate screen"

Any suggestions as to how can I achieve this or what I am doing wrong. 

I am using Jira v8.5.17

 

Thank you 

 

curl -X POST --url https://jira.lab.com/rest/api/2/issue -s -u myaccount:mypass -H 'Content-Type: application/json' --data '
{
   "fields": {
        "project":
        {
               "key":"MYPROJECT"
         },
         "summary":"test epic Link info two",
         "description": "With this test we are including epic link info in api call",
         "issuetype":{
              "name":"Ticket"
         },
         "customfield_10003": "MYPROJECT-766"
  }
} '

 

 

{"errorMessages":[],"errors":{"customfield_10003":"Field 'customfield_10003' cannot be set. It is not on the appropriate screen, or unknown."}}

3 answers

2 accepted

0 votes
Answer accepted
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.
October 27, 2021

Your REST call looks correct to me, so I'd want to do some debugging on the message it's coming back with.  Two tests:

1.  Can you create the issue over REST without the Epic link field?  (i.e. same code, but don't put in the line that sets cf_10003)

2.  Can you manually create the issue, as the user making the REST call, in the UI, filling in the Epic link with myproject-766?

Juan Leon December 7, 2021

@Nic Brough -Adaptavist-  sorry for the late reply.  for question 1, yes I can create a ticket excluding the epic link parameter.

for question #2, I am not familiar with making the REST call in the UI. can you give me an example on how will this be done. 

 

thanks

0 votes
Answer accepted
Fazila Ashraf
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 26, 2021

Hi @Juan Leon 

Welcome to community!

Can you confirm that the field customfield_10003 is available in create screen of the project and issue type?

Are you able to do the same operation from the UI successfully?

Juan Leon October 27, 2021

Hi @Fazila Ashraf  

Thank you for your reply, yes the 'Epik Link' (cf_10003) is available,

jira-create-screen.jpg

0 votes
Juan Leon December 8, 2021

Update: It turned out that I used the wrong customfield number. it was cf_10001 instead of cf_10003.  thanks for your help. 

BHARGAV REDDI May 10, 2023

How do you know that cf_id number is 10001

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.
May 10, 2023

Because you look at the custom field ID?

Suggest an answer

Log in or Sign up to answer