setOwnerUserKey does not seem to work

Description

reminder.setOwnerUserKey(anykey) does not have any effect. The current user always owns the created reminder.

Background: I’d like to create a reminder by a workflow-postfunction, that can only be edited or deleted by other postfunctions. So I want the reminder to be owned by some technical user, and not the current user. But setOwnerUserKey does not seem to work.

Environment

None

Activity

Show:
Axel Joester
February 12, 2020, 6:31 PM

ouch, this should have gone to project REM. could someone please move the issue?

Deniz Oğuz
February 12, 2020, 7:18 PM
Edited

Hi Axel,

Unfortunately addReminder method overrides owner user key with current user. I think we should move this overriding operation to Rest API and our service class should assume owner user key is correct. This will ensure no one can create a reminder for another user using Rest API but also allows scripts to override this behavior. But there may be a workaround which doesn't need a new release.
There is another method:

This method is private and doesn't exist on ReminderService but it exist on ReminderServiceImp class. Since Groovy doesn't care whether a method is private or not, you should able to call this method. Please let me know if you need more information.
You may also want to check whether assignee is null and skip creation of reminder if assignee is null.

Axel Joester
February 13, 2020, 9:38 AM

Hi Deniz,

perfect! It works!

Thanks a lot!

 

Deniz Oğuz
February 13, 2020, 9:42 AM

I'm glad it is working.

Answered

Assignee

Deniz Oğuz

Reporter

Axel Joester

Labels

None

Source

None

Jira Version

None

Database Type/Version

None

Browser Type/Version

None

Priority

Major
Configure