Data from JIRA not returning properly

8 views
Skip to first unread message

Daiane Casagrande Patrício Broca

unread,
Dec 1, 2009, 9:17:32 AM12/1/09
to testli...@googlegroups.com
Olá estou com o mesmo problema do fórum abaixo.

http://64.233.163.132/search?q=cache:TzRyVEIFuOYJ:www.teamst.org/phpBB2/viewtopic.php%3Ft%3D2334%26view%3Dnext%26sid%3Dd38b9ae1e519d7b85aad8320c5a33ba7+%24this-%3EdbConnection-%3Eexec_query%28%24query%29%3B&cd=2&hl=pt-BR&ct=clnk&gl=br
Hi,

I am have connected an instance of JIRA (running on Oracle) to Testlink. The connection to the JIRA database seems to be fine, but Testlink is not parsing the data returned from JIRA properly. In the file:

/lib/int_jira.php

The section where it gets the bug status has the following php code:

Code:
 
       function getBugStatus($id)
        {
                $myFile = "jir.log";
                $fh = fopen($myFile, 'w');

                if (!$this->isConnected())
                        return false;

                $status = false;

                // 20070818 - francisco...@gruppotesi.com
                // $query = "SELECT issuestatus FROM jiraissue WHERE pkey='$id'";
                $query = "SELECT s.pname as issuestatus " .
                         "FROM issuestatus s, jiraissue i " .
                         "WHERE i.pkey='$id' AND i.issuestatus = s.ID";

                fwrite($fh, $query);


                $result = $this->dbConnection->exec_query($query);
                fwrite($fh,$result);
                if ($result)
                {
                        $status = $this->dbConnection->fetch_array($result);
                        if ($status)
                        {
                                $status = $status['issuestatus'];
                        }
                        else
                                $status = null;
                }
                fwrite($fh, "\n");
                fwrite($fh, "Status: ");
                fwrite($fh,$status);
                fclose($fh);
                return $status;

        }



(Please ignore my debug mods) I have printed out the query to the database and ran it in SQL developer:
Code:

SELECT s.pname as issuestatus " .
                         "FROM issuestatus s, jiraissue i " .
                         "WHERE i.pkey='$id' AND i.issuestatus = s.ID


It returns the status as closed. I have also printed out the $result object which the query is returned to:

Code:
$result = $this->dbConnection->exec_query($query);


The contents of the object are too big to post here but you can clearly see the status of the bug as closed in it. Then it goes into the next code block and executes this:

Code:
  $status = $this->dbConnection->fetch_array($result);


The $status variable is set, so it then does:

Code:
 $status = $status['issuestatus'];


The problem is that when I check the value of $status, it's always blank, even though I know for a fact that the database is returning 'Closed' for this particular bug.

Any ideas?

/Jlar

Como posso resolver isso?
--
att,

Daiane Casagrande Patrício Broca
daia...@gmail.com

Twitter: http://twitter.com/daianecpb
Blog: http://daianecpb.blogspot.com
Skype: daia...@gmail.com

Francisco Mancardi

unread,
Dec 1, 2009, 9:18:59 AM12/1/09
to testli...@googlegroups.com
Daiane Casagrande Patrício Broca wrote:
1. official language is english
2. this list is not for bugs => use mantis

--

You received this message because you are subscribed to the Google Groups "testlink-dev" group.
To post to this group, send email to testli...@googlegroups.com.
To unsubscribe from this group, send email to testlink-dev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testlink-dev?hl=en.

Reply all
Reply to author
Forward
0 new messages