SPEL in issue email configuration


#1

Hi,

is it possible to use SPEL to configure the mail-to-address value? I’d like to give conditional value with SPEL here to integrate the ShinyProxy issue feature with GitLab using the “issue by email” feature.
I tried to do something like this:
mail-to-address: “#{#{proxy.userId} == ‘USER1’ ? ‘email1@email.com’ : ‘email2@email.com’}”

I’ve no experience in SPEL, so any help is appreciated.
Finally I want to make a nested conditional expression, to map the users personal GitLab address to their ShinyProxy userId.
Of course I’m interested in any other equivalent solution.

Thx
Tibor


#2

Hi,

It’s a little bit more complicated. I think the solution could be if this property can be defined (overriden) in proxy.specs section (because the email address unique not just for user, but for GitLab project too).
What do you think guys from the OpenAnalytics? Does it make sense to integrate the “issue report” to GitLab issues?

Thx
Tibor


#3

Hi @theja,

No, unfortunately SPEL expressions are not supported on the global application properties.
Only the container properties in the specs section support SPEL expressions, and those are evaluated only during startup of the container.

For your use case, I believe the following changes might work:

  • Modify IssueController so that it accepts the mail-to-address as a request parameter
  • Use a custom template for navbar.html so that an appropriate mail-to-address is calculated (you can use SPEL expressions in templates), and included in the form that is submitted to /issue.

#4

Hi,

Thank you for your answer.
I’m not a java developer, so I don’t want to mix the code :-).
I found a workaround with the Shinyproxy-GitLab integration, without code-change.

Thanks again and congratulation for ShinyProxy.

Tibor