magixyu
1/24/2017 - 2:36 AM

Update Jira for estimation

Update Jira for estimation

use JIRA::Client::Automated;
$url="https://greenhopper.app.alcatel-lucent.com";
$user="username";
$password="password";
my $jira = JIRA::Client::Automated->new($url, $user, $password);

$jira->trace(0); # enable tracing of requests and responses
$jira->ua()->ssl_opts(verify_hostname => 0);
 
my $jql = "Project = OMC and assignee = jianfeay and type=epic and fixversion = \"COM R5.2\"";
my @issues = $jira->all_search_results($jql, 1000);

# customfield_14491 => THCM-QD
# customfield_14402 => Feature E1 (THCM)
foreach my $issue (@issues) {
    my $key = $issue->{key};
    my $e1 =  $issue->{fields}{"customfield_14402"};
    my $thcmqd = $issue->{fields}{"customfield_14491"};
    if ( $thcmqd != $e1 ) {
        print $key, "\t", $e1, "\n";
 
        $jira->update_issue($key, {"customfield_14491" => $e1 + 0.0});
        print "press enter to continue: ";
        <>;
    }
}