Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to deal with optional confiForms fields when passing data to JIRA create issue api

jokolbe August 14, 2020

I have an optional Form Field in my form

name: due
field type: Date
format: yyyy-MM-dd

Using ConfiForms IFTTT Integration Rules
event: onCreated
action: Create JIRA Issue

I'm passing the following:

{ 
"fields": {
...
"duedate": "[entry.due]",
...
}
}

 

Since it's an optional field, when I do not fill out value I'm getting the following error:

com.atlassian.sal.api.net.ResponseException: Error communicating with Jira, Bad Request {"errorMessages":[],"errors":{"duedate":"Error parsing date string: "}}

How do I deal with passing optional fields into Creating JIRA issue call?

1 answer

1 accepted

0 votes
Answer accepted
Alex Medved _ConfiForms_
Community Champion
August 14, 2020

We have a virtual function to help you specifically with that

"duedate": "[entry.due.jiraDate]"

https://wiki.vertuna.com/display/CONFIFORMS/Virtual+functions 

Optional fields can be handled with Velocity templating, as shown here: https://wiki.vertuna.com/display/CONFIFORMS/Configuring+ConfiForms+IFTTT+actions+and+rules#ConfiguringConfiFormsIFTTTactionsandrules-CreateJiraIssue

(unless it is disabled for ConfiForms app by your system admin)

jokolbe August 14, 2020

@Alex Medved _ConfiForms_ how do I incorporate the IFTTT rules, this doesn't work

{
"fields": {
"summary": "[entry.title]",
#if(!${entry.due.isEmpty()})
"duedate": "[entry.due]",
#end
"customfield_13162": { "value": "[entry.brand.label]" },
}
}
Alex Medved _ConfiForms_
Community Champion
August 14, 2020
{
"fields": {
"summary": "[entry.title]",
#if(${due})
"duedate": "[entry.due.jiraDate]",
#end
"customfield_13162": { "value": "[entry.brand.label]" },
}
}
jokolbe August 14, 2020

when I do this, the JIRA issue is not created unless I fill out the due Date in the form

Alex Medved _ConfiForms_
Community Champion
August 14, 2020

Do you see an error from Jira? What kind of error?

jokolbe August 14, 2020

There is no error that I see on form submission at all. I just dont see the issue created nor I get any issue number back

Screen Shot 2020-08-14 at 11.33.25 AM.png

jokolbe August 14, 2020

My apologies, I had an extra condition on the IFTTT !due:[empty] that I didn't remove

Working perfectly fine!

Noah Leu -MESKRU GmbH-
Community Champion
September 15, 2021

Hey @Alex Medved _ConfiForms_ ,

I tried this with a date field the same way. It is suppose to be optional and should only provide a date, if the field is filled/ a date is selected. Otherwise there should not be a date parsed to Jira.

However it throws an error regarding the if clause.

Do you have an idea what the issue is? Thanks in advance.

ConfiformsIssue1.pngConfiformsIssue2.png

Alex Medved _ConfiForms_
Community Champion
September 15, 2021

Most probably, in your Confluence instance ConfiForms has an option to evaluate the contents as Velocity template disabled

https://wiki.vertuna.com/display/CONFIFORMS/Release+Notes?preview=/31096895/49415735/confi-conf-velocity.png 

Could you check with you admins? 

Alex

Noah Leu -MESKRU GmbH-
Community Champion
September 17, 2021

Hey @Alex Medved _ConfiForms_ ,

thank you very much! It was indeed disabled. Now its working perfectly!

Suggest an answer

Log in or Sign up to answer