Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

create task inside an epic using postman

Sergio Garcia January 26, 2023

Hello, I want to create a task inside an epic using postman, I manage to create the task, but it remains without being inside an epic.
Thanks for the help.

 

{
    "fields": {
        "project":
        {
            "key":"TEST"
        },

        "summary""Jira summaru",
        "description":{
            "type":"doc",
            "version":1,
            "content": [
                {
                "type""paragraph",
                "content": [
                    {
                        "type""text",
                        "text""text of description"
                    }
                ]
            }
            ]  
        },
        "customfield_10000" : "Epic name",
        "issuetype":
        {
            "name":"Task"
        }     
    }
}

1 answer

0 votes
Vamsi Kandala
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.
January 26, 2023

Hi @Sergio Garcia

Welcome to the community!

If I understand you correctly, you want to specify another ticket as 'Epic Link' to this task that you are creating.  That way, when you go to that epic ticket you will see this task as well under 'Issues in epic'.

Can you try providing the Epic ticket number instead of the Epic name here like:

"customfield_10000" : "EPIC-12345",

And try?

Hope this helps.

Thanks,
Vamsi

Sergio Garcia January 27, 2023

Hi,

It doesn't matter what you put in the customfield_10000, the task is created, but never inside the epic

Vamsi Kandala
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.
January 27, 2023

Hi @Sergio Garcia

I have tested it out at my end and it worked well.

Did you ensure that the ticket you provided for 'customfield_10000' is of 'Epic' issue type?

I replaced your code with the following:

{
    "fields": {
        "project":
        {
            "key":"TEST"
        },
        "summary""Jira summary",
        "description":"text of description",
        "customfield_10000" : "EPIC-12345",
        "issuetype":
        {
            "name":"Task"
        }     
    }
}
Thanks,
Vamsi
Trudy Claspill
Community Champion
January 27, 2023

How did you determine that 10000 is the correct ID for the Epic Link field?

You can find the field ID by going to the Settings > Issues > Custom Fields screen. Search for the field. Click on the ... to the right of the field. Hover over one of the options in the context menu. The URL for the option will show at the bottom of the browser screen and will include the ID for the field.

Screen Shot 2023-01-27 at 3.11.42 PM.png

Vamsi Kandala
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.
January 28, 2023

Hi @Trudy Claspill

Thank you for your response.

I verified the custom field id for 'Epic' issue type in the Jira Cloud instance and created the ticket via Postman.

Regards,
Vamsi

Sergio Garcia January 28, 2023

Hi,

@Trudy Claspill I have checked the fields as you have indicated.

Epic Name: 10011

Epic Link: 10014

@Vamsi Kandala I have tried with the two customfields, putting the name "myepic" or the number "TEST-25", but postman does not return anything, I attach capture.

postman1.JPG

I have also tried with my first code and I get this error.

errors": {
        "customfield_10011""Field 'customfield_10011' cannot be set. It is not on the appropriate screen, or unknown."
postman2.JPG
Vamsi Kandala
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.
January 28, 2023

Hi @Sergio Garcia

You should use the 'Epic Link' field and pass the Epic key value.  

The reason for the error when you used 'customfield_10011' is that the related field is not present in the Create screen of that issue type.  Try adding the field to the Create screen and check again.

Thanks,
Vamsi

Sergio Garcia January 29, 2023

Hi,

@Vamsi Kandala You should use the 'Epic Link' field and pass the Epic key value. 

Do you mean use it like this? or as?

"customfield_10014": "TEST-25"

 

I don't see the create screen, these are the screens I see.

pantallas.JPG

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events