Create a bug by call rest api, but the post function does not work

I create a custom field called “Bug Description” in create issue screen. I can create set the default value for bug template. And I add a post function to copy the text of “Bug Description” to “Description”. It works fine to create a bug manually.
But I try to create issue by rest api. I can create the issue successfully, but the value of Description is empty. The value of Bug Description is correct. So guess the post function does not work.

This my payload:

{
“update”: {
},

"fields": {
    "summary": "autotest3",
    "issuetype": {
        "name": "Bug"
    },
    "project": {
        "id": "11107"
    },
    "customfield_11278": { 
        "type": "doc",
        "version": 1,
        "content": [
            {
                "type": "paragraph",
                "content": [
                    {
                        "text": "auto111",
                        "type": "text"
                    }
                ]
            }
        ]
    },
    "reporter": {
        "accountId": "60c0e116a01e11006ae66369"
    },
    "priority": {
        "name": "Medium"
    },
    "customfield_11261": {
        "id": "10260" 
    },
    "customfield_11249": {
        "id": "10240" 
    }
}

}

1 answer

1 accepted

0 votes
Answer accepted
Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 9, 2021

Hi @梁峰 Jeff Liang (Engineering - QA)  do you get any error in the server response?

No, It created the bug successfully. But did not trigger the post function.  I used rest/api/3/issue.  Yesterday I tried rest/api/2/issue, it works.  Is my payload wrong ? Or is it a bug of rest api3.

Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 10, 2021

Hi @梁峰 Jeff Liang (Engineering - QA) ok, I just tested it and it really looks like a bug. I will raise a ticket for it. But I also found a workaround.

If you use Automation, it works. I prepared automation like this:

Workspace 1_237.png

Thanks

Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 4, 2021

Hi Jeff just for your information. Atlassian created bug for not-working Copy field data postfunction: https://jira.atlassian.com/browse/JSWCLOUD-21782?error=login_required&error_description=Login+required&state=6e713adf-5385-49bb-9838-8843a01303da

 

What about automation workaround? Did it work for you?

it works

Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 4, 2021

Ok, cool, would you be so nice and accept the answer? It might help other people who will need to copy field value on Create transition.

Suggest an answer

Log in or Sign up to answer