Pass jira issue key and issue status to jenkins job through custom post function

Hi,

I am new to groovy script and I used the following script to trigger jenkins job

import com.atlassian.jira.issue.Issue
def launch= ["wget", "--auth-no-challenge", "--user=username", "--password=password", "https://jenkins.com/vz/job/VZW.MYV.JIRA.test/build?token=jira&delay=0sec&JiraIssue=${issue.key}"].execute().text;
println launch

this will trigger when the issue has been closed. Without passing JiraIssue parameter am able to call jenkins job once adding the parameter it is not triggering the jenkins job, but I need  to pass issue key and the status of issue to Jenkins job.
Any suggestions for this problem

 

 

3 answers

0 votes
Timothy Chin Community Champion Nov 03, 2016

This should be a question that you should ask in the Jenkins forums right?

I want to know the syntax what I am using in custom post function is correct and how to pass issue status and assignee in the Jenkins url like passing issue key

0 votes

Try buildwithParameters? instead just build

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Feb 15, 2018 in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

1,107 views 6 19
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot