Rock
Rock copied to clipboard
Workflow Action "Reminder Add" - Reminder Date & Notes not honored
Description
Trying to use the workflow action "Reminder Add" to create a reminder for a future date and include a custom note from the user ... the reminder is created - but the reminder date on it is the current (run) date (not the future date) ... and the note field is populated with a GUID (probably for the workflow text attribute that has the custom note.
Actual Behavior
The Reminder Date on the reminder created by the workflow action is the current/run date - not the future date stored in the provided workflow attribute. The Note on the reminder is what looks like a Guid ... and not the custom text from the workflow attribute that was provided to the action.
Expected Behavior
The created reminder should have reminder date and note that match what was provided by the workflow attributes.
Steps to Reproduce
-
Create a workflow that has 4 attributes: CurrentPerson, TargetPerson, ReminderDate, & ReminderText
-
Add following actions:
-
In the form - allow user to pick the target person, reminder date, & & reminder text.
-
Setup the reminder action as shown above.
-
Run the workflow and select a target person, a reminder date in the future, and enter reminder text.
-
After completion - go to your reminders and confirm values on the newly created reminder ... note that the reminder date is the current date not the one you entered - and the note value is a guid.
I've also included the export of the workflow I setup on the demo site to confirm the bug we were seeing on our site. Test Reminder Add action_202403011417.json.zip
Issue Confirmation
- [X] Perform a search on the Github Issues to see if your bug or enhancement is already reported.
- [X] Try to reproduce the problem on a fresh install or on the demo site.
Rock Version
1.16.2.1
Client Culture Setting
en-US
Additional side note ... I also tried using Lava in the other setting fields (instead of the attribute value dropdown) - and this was worse. The action step completes without any exceptions or messages in the log - but the reminder was NOT created. As best as I was able to determine it was related to the Reminder Date ... I tried all different variations on the format for the date - but if I provided anything in that field - the reminder would NOT be created - with no indication of why.
I can confirm that you could put static text in the Note field - and that would be saved to the reminder - but that really does us no good as we want the user to be able to put their own text in the reminder.
Not sure if this is it or not ... but I was comparing the code for AddStep.cs to AddReminder.cs ... and I wonder if these 2 calls to GetAttributeValue need to have a 3rd parameter of 'true' ... so that the AttributeValue is considered.
reminder.Note = GetAttributeValue( action, AttributeKey.Note ).ResolveMergeFields( mergeFields );
reminder.ReminderDate = GetAttributeValue( action, AttributeKey.ReminderDate ).ResolveMergeFields( mergeFields ).AsDateTime() ?? RockDateTime.Now;
For what it's worth, I just ran into this issue on v15.4. I can confirm @stanalyst's results...
- The Note text field works properly
- The Note attribute results in a guid in the reminder note
- The Reminder Date text field results in no reminder at all
- The Reminder Date attribute results in a reminder with today's date