IFTTT action against a Checkbox Group
Asked by Jason Walsh:

I have a checkbox group field in my form with 5 options. On created, I have IFTTT macros that create a JIRA story based on what was checked.

The end user also has the ability to go back into the Confiforms record and check additional values that were not checked initially. My rule to do that is as follows:

**hasChanged(partners):true AND !_previousState.partners:1 AND partners:1**

Essentially making sure that the checkbox group has changed and that previous value for that checkbox \<\> the new one to avoid creating duplicates. In my head this logic works, and I create the JIRA story as intended, however I create a duplicate JIRA story for all the checked values in the form.

For example, if I had only initially checked off the first box (partners:1) and left the others blank, I'd create a JIRA story for that.

If I edit the record and check off the second box (partners:2) - I create a JIRA story for Partners 2 and an additional JIRA Story for Partners:1. 3 Story's in total with a duplicate of partners:1

Am I missing something?


Answers:
author: Alex Medved _ConfiForms_
body: Hi

You say you are having IFTTTs to run **onCreated** and these checks for PREVIOUS state of a record

This is not correct, as the record has NO PREVIOUS state

Same goes for "hasChanged" function... makes little sense to use it in IFTTT that runs onCreated event

Alex

comments: author: Jason Walsh
body: The IFTTT macro for the update is an On Modified - Create JIRA Issue with the aforementioned logic. Sorry, I should have clarified.


author: Alex Medved _ConfiForms_
body: You have said...
> On **created**, I have IFTTT macros that create a JIRA story based on what was checked.

If you say you have this onModified then the condition should be about right... However, it will notreally work for the requirements you have. As previousState holds only the data for "last modification"...

Alex


author: Jason Walsh
body: Ahhhh ok that makes sense and apologies again for being unclear with what I was attempting to do here.

So previousState is looking for the previous "modification" so yes, that will not work with my scenario. Is there a way to look for "hasChanged" pertaining to a value in a checkbox group? I feel that something like:

**hasChanged(parners.hasValue(1)):true and partners:1** would work (syntax aside)

Thoughts?


author: Alex Medved _ConfiForms_
body: I dont understand... what are you trying to check? You see, you need to create back the flag (field value) that the issue for some status has been created - this is the only way you can ensure you dont create duplicates

hasChanged and hasValue make no sense here, sorry

Alex


author: Jason Walsh
body: All I'm trying to do is create a JIRA record once one of the checkbox's has been checked against the checkbox group field. This happens with my "On Created" IFTTT macro and when edited to include a newly checked box with "On Modified". Essentially, if previous value for checkbox group is FALSE and current value is TRUE, then create JIRA issue.

The problem that I'm running into occurs when I modify the checkbox group to include a previously unchecked value. I have "On Modified" IFTTT macros to accommodate all 5 options in the checkbox group. My "On Modified" IFTTT macro creates the JIRA record for the newly checked value, but the other "On Modified" macros execute again for values where already checked before the modification was made to the record.

Does that make more sense? Is there a solution for this perhaps?


author: Alex Medved _ConfiForms_
body: That is why I tell you to store separately the information about created issue.

Logically, you cannot track that with a checkbox group... as it may change between the edits and you loose your previous state.

So, you need to store back to form's record (for each option in a checkbox separately) the status about created issue.

This could also be tracked in a checkbox group.. but the one that is hidden from users and used ONLY to track already created issues

Alex


author: Jason Walsh
body: BINGO! That was it. All I had to do was track the changes in separate fields and now my logic works without issue. You're amazing Alex, that you for your patience and wisdom!


Tags: confiforms

confluence-server

server