Automating ticket creation for projects that require a component?

Scott Robinson May 8, 2017

I would like to fully automate ticket creation for a program I am running within my organization. I am using the JIRA api to do this, but I'm running into problems with projects that require a component. It seems there is no way way to choose a default component or override the component requirement via api, so my program fails to create tickets for these projects. This is currently a blocker for the program, since it requires full automation. Any thought on how to work around this?

2 answers

0 votes
Steven F Behnke
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.
May 8, 2017

Well, you'll need to handle requirements per project. If a project has fields marked as required, you must provide them otherwise the call will fail.

You can use the createMeta endpoint to discover what fields are required. (Developer article: https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-discovering-meta-data-for-creating-issues) 

You can use the getProjectComponents endpoint to discover what options there are in a specific project. (API article: https://docs.atlassian.com/jira/REST/server/#api/2/project-getProjectComponents)

0 votes
MattS
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.
May 8, 2017

Use a component named "Needs Triage" is one way.

Or name the component "Created automatically"

Components are generally used for auto assigning issues to the right person. But there isn't a way to specify one component as the default.

Suggest an answer

Log in or Sign up to answer