Using JQL in perl

Hi All,

We have few teams who are directly connecting to JIRA DB as read access through perl and running SQL queries.

Due to DB structure change SQL queries are failing and causing issue.

To avoid such situations we need users to use JQL but we are not sure how to use JQL from perl code.

For sample we are using below code

{code}

my $sth_use = $dbh->prepare("use jira");
    $sth_use->execute();

    my $sqlCmd = "select ji.issuenum, ji.SUMMARY, ji.ASSIGNEE 
                         from jiraissue ji, 
                              project p,
                              nodeassociation n,
                              projectversion pv 
                         where ji.issuestatus in ($gestatus) and
                               ji.project = p.ID and
                               p.pname = 'Projectname' and
                               ji.id = n.SOURCE_NODE_ID and
                               n.ASSOCIATION_TYPE='IssueFixVersion' and
                               n.SINK_NODE_ID = pv.id and
                               pv.vname in ('${fixVersion}', '$filterFixVersion', '$prebau') ${xj}";

    jvcTrace("$sqlCmd\n");
    my $sth = $dbh->prepare($sqlCmd);

    $sth->execute();

{code}

 

Thanks and Regards,

Pankaj

1 answer

You and use JIRA Command Line Interface (CLI) and run the getIssueList command from perl. Use the jql parameter.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,322 views 14 20
Join discussion

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