Here I have a Jenkins pipeline script with input command shown below,
def newTag = input(
id: 'newTag', message: 'Line 1 \n Line 2 \n Line 3 \n Line 4', ok: 'CREATE TAG',
parameters: [
string(
defaultValue: 'temp',
description: 'Enter carefully for new tag',
name: 'tagName'
),
]
)
But I got a message in the same line like : Line 1 Line 2 Line 3 Line 4. So I have tried with <br>
tags for new lines like shown below:
message : 'Line 1 \n <br> \n Line 2 \n <br> \n Line 3 \n <br> \n Line 4'
But it doesn't care about <br>
tags. How can I introduce new lines in the message while it is opened in the url jobName/tryNo/input/
through running log in Jenkins?
Note : I don't want to view input in pop up console. I want this new line introduced message in above shown url link input window.
A closed issue in Jenkins Jira says that now the input message renders new line. It was marked as resolved in 2017-07-21, maybe you should upgrade your Jenkins to get it.
Unfortunately, it looks like it isn't possible to display html formatted strings in the input step message. I'm also trying to find a solution for this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With