I am getting a 400 Bad Request when cloning an issue in the post function of a transition

Janina Kotze September 28, 2019
WARN - POST request to /rest/api/2/issue returned an error code: status: 400 - Bad Request
body: [errorMessages:[], errors:[issuetype:The issue type selected is invalid.]]
2019-09-26 10:31:51.099 INFO - POST /rest/api/2/issue asObject Request Duration: 418ms
2019-09-26 10:31:51.339 ERROR - Failed to create issue [fields:[project:[id:12415], issuetype:[id:10300]]], response status 400. Expression: ((createReq.status >= 200) && (createReq.status < 300))

 

The above is the error message

I have a service desk project and added a post function to run that will clone the created issue on a different project

 

I added the new issue type to the issue type scheme of the service desk project

I added the new issue type to the issue type scheme of the other project

 

The on the workflow schems

On the service desk workflow scheme, I assigned a different workflow to the new issue type

On this workflow is where I added the post function - when a issue is created.  My expectation is that only when I create a new issue on the service desk project - equal to the new issue type I added -  will it follow the workflow I indicated for it in the workflow scheme.

 

However - when trying to clone it gets the error indicated above

3 answers

1 accepted

1 vote
Answer accepted
Janina Kotze September 29, 2019

Hi Jack

Thanks for fast reply.  Sorry - the problem was between the chair and the laptop...  I selected the wrong issue type incorrectly, then made an update but never clicked publish to save the changes... 

I have a further question though.  Will log it just now.

Jack Nolddor _Sweet Bananas_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
September 29, 2019

Hehehe
Just a PEBCAK

0 votes
Noah September 28, 2019

Based on the error information

issuetype:The issue type selected is invalid

The issue type of the original issue doesn't exist on the project where you want to clone the issue.

But based on what you described, you already added the new issue type to the issue type scheme of both projects so I think it's because the status of the original issue doesn't exist on the list of available status on target project. 

For example if the status of the source issue is DRAFT, then if the issue is automatically cloned to another project by post function, make sure the DRAFT status is available on the target project. 

If that's not the case. Please take screenshots requested by Jack. Cheers! 

0 votes
Jack Nolddor _Sweet Bananas_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
September 28, 2019

Hi Janina Kotze and welcome,

 

Do you mind to further explain how the postfunction is setup? Are you using a configuration screen provided by a third-party app? Is a groovy script you've developed?

If possible, try to attach an image with the current postfunction configuration and the issue type scheme used by the destination project.

Regards

Suggest an answer

Log in or Sign up to answer