How to set request field to null during creation when a default value is defined?

Hi,
I’m creating requests using /rest/servicedeskapi/request but I haven’t been able to figure out how to set a request field to null/undefined if there is a default value defined. Anyone have an idea on how to do this? I know it is possible when creating issues using the JIRA API but the same approach don’t work for requests.

Hi Jenny,

Unfortunately it isn’t possible to create a request with a null field value if that field has a default value using the Jira Service Desk Cloud REST API. The request creation endpoint does not allow any null values for request fields (you will get a 500 response), so your only option is to not specify the field at all. If the field does not have a default value set this will result in the field being null, otherwise it will take the default value.

As a workaround, I suggest calling Jira’s Edit issue endpoint immediately after creating your request to set the field to null. For example, if the request creation endpoint returned an issue key of TST-123 and you wanted customfield_10100 to be null, you would PUT the following to /rest/api/3/issue/TST-123:

{
    "fields": {
        "customfield_10100": null
    }
}