I have been trying to put a condition on ConfiForm in order to update Jira ticket based on user selection on the ConfiForm, but it is not able to create Jira ticket. The code is working fine without the condition.
The same code is working when I am using "Create Jira Issue" Action. But While trying with Web Service Request it is not working.
Example condition, where I am trying to put label on Jira based on whether the user has attached file or not, "fi" is the field for attachment:
#set($attachment = "[entry.fi]")
#if($attachment == "")
"labels": ["ContentNA"],
#else
"labels": ["Content"],
#end
The contents is processed absolutely the same way - so if it works for "Create Jira issue" then it should work for "Web service request"
See also https://wiki.vertuna.com/display/CONFIFORMS/Configuring+ConfiForms+IFTTT+actions+and+rules#ConfiguringConfiFormsIFTTTactionsandrules-CreateJiraIssue for examples on how to check fields for values...
If an attachment IS a file field then checking it for empty value like that will never work.
As it is a "multi-value" field and should be checked with isEmpty function
Alex
Thanks @Alex Medved _ConfiForms_
#if($attachment.isEmpty()) worked for me.
Apart from this, I got below error too when I was not attaching any file:
Requested to https://jira.xxxxx.xxxxx.com/rest/api/latest/issue/xxxxxx/attachments has resulted in error. Response code = 415. Response contents:
This I managed to remove by checking on "Do not report error" checkbox.
Is it the right way to do it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What content type do you set in the IFTTT that attempts to upload attachments?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't see any content type in the IFTTT. Attaching a screenshot related to the attachment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Setting this to "do not report the error" does not fix the error
Attachment will not be uploaded
What do you have in the Request headers for the IFTTT that attempts to upload the file?
What is the HTTP method parameter?
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Alex Medved _ConfiForms_ The error was coming only when I am not attaching anything. If I am attaching a file, this error is not coming.
For request header - Earlier it was the same as the above screenshot: "X-Atlassian-Token: no-check;"
But I have removed it now, thinking this was causing the error. But nothing changed after removing this as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Was confused by your earlier comments, I thought you were still struggling to upload an attachment
So, you need to make the IFTTT conditional
Checking if the attachment is present, before attempting to upload it
!fuDesc:[empty]
Assuming the field is named "fuDesc" in your form
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad to hear that
Accept the solution ;)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you catch the news at Team ‘25? With Loom, Confluence, Atlassian Intelligence, & even Jira 👀, you won’t have to worry about taking meeting notes again… unless you want to. Join us to explore the beta & discover a new way to boost meeting productivity.
Register today!Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.