The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Using JQL in perl

Pankaj Pimple
May 11, 2015

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Bob Swift
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
May 13, 2015

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

TAGS
AUG Leaders

Atlassian Community Events