Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I provide jenkins pipeline input message string with html tags

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.

like image 382
Bhanuchander Udhayakumar Avatar asked Nov 07 '22 05:11

Bhanuchander Udhayakumar


1 Answers

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.

like image 105
neves Avatar answered Nov 16 '22 15:11

neves