Rest service fails when a jira field is passed which is not present in the jira issue

We are using the jira rest api ‘create issue’ to create an issue via rest integration.
In our Jira instance for the issue types defect or Story, we have removed the priority field.
Now when try to integrate with some other app to jira and create a issue, In the request params the field priority is also set. Then the rest integration fails saying ‘Prirority cannot be set. It is not on the appropriate screen, or unknown’.

As here priority field is not present in jira issue type its failing and its correct. But our integration connectors we have written to connect to jira are generic for different jira instances. So we cannot customize the request parameters based on the jira instance .
So do we have any flag, which we can set the in the request parameters so that it will ignore the fields which are not present? Please let me know. Thanks.

You need to hit the create meta end point to identify which fields are required. There’s a write up at JIRA REST API Example Discovering Meta Data for Creating Issues 6291669 that talks through some of that.

1 Like