Triggering a paramaterized build, and inserting the git branch id

675 views Asked by At

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

1

There are 1 answers

9
SV Madhava Reddy On

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 Parameterised Example

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