Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sidebar link with Jenkins user name veriable #26

Open
kooyunmo opened this issue Aug 26, 2021 · 2 comments
Open

Sidebar link with Jenkins user name veriable #26

kooyunmo opened this issue Aug 26, 2021 · 2 comments

Comments

@kooyunmo
Copy link

kooyunmo commented Aug 26, 2021

Feature Request

Hi, thank you for the great useful plugin.

It seems that the sidebar plugin does not allow to use any environment variable for the URL (e.g., https://example.com&user=$USER_NAME). I wish to use the dynamic URL link containing the logged-in Jenkins user ID. Is there any way to do this?

@damianszczepanik
Copy link
Member

You are right. I don't know if USER_NAME is known from context plugin. Maybe TokenMacro can be added as dependency to have support for some variable

@KalleOlaviNiemitalo
Copy link
Contributor

KalleOlaviNiemitalo commented Feb 27, 2022

The TokenMacro.expand, TokenMacro.expandAll, and TokenMacro.evaluate methods take a Run<?,?> or AbstractBuild<?, ?> parameter and often assume that the value is not null. This does not seem suitable for sidebar links of a job, agent, folder, or the main page. I think a custom parser and a custom set of macros would be a better solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants