Confluence ConfiForms - Sending Email when a specific field is modified in TableView
Asked by davin:

Hello,

I have a tracker created through ConfiForms that has a "Status" dropdown field with three options - Open, In Progress, Closed. When ever a new record is created, by default the status is set to Open. But as we work on the record, we use inline editing on a TableView to change multiple fields of the record.

My requirement is, can we send a custom mail using IFTTT only when the Status field specifically is modified (i.e. from OPEN to IN PROGRESS and then to CLOSED). We might make other changes within the record but that shouldn't trigger a mail.

I have seen this [Checkbox Approach](https://wiki.vertuna.com/display/CONFIFORMS/Sending+email+from+Confluence+with+ConfiForms+IFTTT+macro+conditionally) in the documentation but since we do inline editing on a TableView, this won't work for us.

I have also seen the [Change Log](https://wiki.vertuna.com/display/CONFIFORMS/Sending+the+change+log+via+email) example in the documentation which talks about using the "*hasChanged(propertyname)*" method and was wondering is there a way to use this in the Condition field for IFTTT?

Any other approach is equally welcomed!

Thanks


Answers:
author: Alex Medved _ConfiForms_
body: Hi

Of course you can use hasChanged(fieldname) in conditions!

You can also have a condition that tracks the transition from one value to another - <https://wiki.vertuna.com/display/CONFIFORMS/Virtual+functions>

See the documentation for "hasChanged" function

Alex

comments: author: davin
body: Hi Alex, as always you are a saviour.

This works exactly has needed!

But now I have another question for you.

I tried using the "_previousState" function mentioned in the link you shared, to add from which Status is the request transitioning to. So I simply added "_previousState.Status" in the Field Name for a Form Field Macro to reference the previous state as you can see below.

![aaa.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/152181i7662059DC4D7C80E/image-dimensions/449x187?v=v2 "aaa.jpg")

Now it did work correctly but since the Status field in my form uses the "Status" field type itself which at the back end is saved using its constant value (i.e. - red is "error", green is "success"), the "_previousState" function displays the constant value and not the actual value of the field.

In the below example, I transitioned the status from Completed (green i.e. success) to Open ( red i.e. error). But in the final example as you can see, the previous state shows the constant value and the normal field works correctly. Is there anyway to fix this?

![aaaa.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/152180iF57193B7197C62D6/image-size/large?v=v2&px=999 "aaaa.jpg")


author: Alex Medved _ConfiForms_
body: Hi

_previousState is available only in IFTTTs.

There is no previous state when record's data is rendered.

Only when it is changed and at the moment it was changed. So it means it is either in IFTTT conditions or in Field Definition Rules

Alex


author: davin
body: Ah, okay.

But its funny how it does show the correct value but just the constant value and not the actual value.

Anyway, this will work for me. Thank you so much!


Tags: confiforms

confluence-server

email

ifttt

server