简体   繁体   中英

Triggering a paramaterized build, and inserting the git branch id

my jira issue is connected to Git pull requests, and i would like to trigger a jenkins job when a jira status changes. but one of the parameters the jenkins job requires is the branch, how can i pass the branch parameter from my jira issue to jenkins?

more info:

my jenkins build is expecting to get a Git branch name. This the information i need to parse from the JIRA issue

so my question is, how do i inject the branch name via the parameter mapping provided by the Jira-trigger-plugin

You can make this project as Parameterised and pass parameters as String Parameters . Just Browse to Jenkin's Job -> General -> This project is parameterised and now choose which type of parameter you want. In your case, its a String Parameter . Please refer this image.

Jenkins参数化示例

You can access your parameter by $parameter_name_goes_here . From above pic parameters are $JIRA_TICKET_ID and $USER_EMAIL . Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM