hashvariable in notification plugin

Confluence User - 16 Dec, 2022

Hi,

I have a problem with hashvariable in notification.

You can see below :

  • configuration for plugin "User notification"
  • the result in a mail


#assignment.processName# = "Départ d'un agent"

If I use #assignment.processName# alone, no problem.

If I use the expression #exp.'{assignment.processName?expression}'.isEmpty()?'empty':{assignment.processName}#, the hashvariable assignment.processName is unknow.


What's wrong ?






process;activity

5


19 Dec, 2022
confluenceUser
confluenceUser

add single quotes for the else statement

from

#exp.'{assignment.processName?expression}'.isEmpty()?'empty':{assignment.processName}#

to

#exp.'{assignment.processName?expression}'.isEmpty()?'empty':'{assignment.processName}'#

19 Dec, 2022
confluenceUser
confluenceUser

Thank you !

In fact, I have already changed the expression with quotes to have :

#exp.'{assignment.processName?expression}'.isEmpty()?'empty':'{assignment.processName}'#

And the response is

{assignment.processName}

20 Dec, 2022
confluenceUser
confluenceUser

which version are you using? 

20 Dec, 2022
confluenceUser
confluenceUser

I use the last one.

7.0.34

20 Dec, 2022
confluenceUser
confluenceUser

In user notification plugin, I identify this code :

https://github.com/jogetworkflow/jw-community/blob/50d9017f1d548c6cce76a42fe5b8ecf9261adcd9/wflow-core/src/main/java/org/joget/apps/app/lib/UserNotificationAuditTrail.java


                                        } else {
                                            String tempEmailMessage = emailMessage;
                                            if (emailMessage.contains("#assignment.link#")) {
                                                tempEmailMessage = tempEmailMessage.replaceAll(StringUtil.escapeRegex("#assignment.link#"), StringUtil.escapeRegex(tempLink));
                                            } else {
                                                tempEmailMessage = emailMessage + "\n\n\n" + tempLink;
                                            }
                                            formattedMessage = AppUtil.processHashVariable(tempEmailMessage, wfAssignment, null, replace);
                                            
                                            //TODO: consider replace the next line to platform-wise support parsing of hash variables in the value returned by another hash variable
                                            formattedMessage = AppUtil.processHashVariable(formattedMessage, wfAssignment, null, replace);
                                            
                                            email.setMsg(formattedMessage);


Is my code in the TODO case ?


RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print