Problems with the Rest API and due date

Chris Thomas
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 21, 2021

I have seen the other on this exact same topic but none of them seemed to help.

 

I am using an addon called ConfiForms to create a ticket from Confluence to Jira software. I have been able to get it to create tickets but I'm having problems with the date fields. Both Due Date and custom date picker fields cause the same errors.

ConfiForms uses an API key for authentication and has proper security.

If I pull the duedate field and any custom fields with the date picker the code works fine. This is the error I get:

You need to post a valid JSON to the service. This is what you are trying to post: { "fields": { "project": { "key": "IO" }, "summary": "New order", "description": "New order for an un-named user.", "customfield_10064": "Test", "customfield_10065": "123", "customfield_10071": "Test", "duedate": "2021-05-28" "issuetype": { "name": "Task" } } }

 

Please note that I am using the new confluence editor and the /code macro for the JSON as suggested by the ConfiForms developer.

 

Edit: This is the date format for the server: 

jira.date.picker.java.formatMM/dd/yy  
jira.date.picker.javascript.format%m/%d/%y  
jira.date.time.picker.java.formatMM/dd/yy h:mm a  
jira.date.time.picker.javascript.format%m/%d/%y %I:%M %p

1 answer

1 accepted

1 vote
Answer accepted
Alex Medved _ConfiForms_
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 21, 2021

Hi

Just like the error tells you - the JSON you are trying to post is invalid

It is missing comma after the dueDate field mapping

Screenshot 2021-05-21 at 18.16.07.png

Alex

Chris Thomas
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 21, 2021

I have spent a few hours on this and now it works. Looks like I need to get a JSON editor.

Thanks!

Suggest an answer

Log in or Sign up to answer