Example #1
0
 /**
  * Loads and returns a jira issue.
  *
  * @param string|int $key issue key or id to load
  * @return \biologis\JIRA_PHP_API\Issue Issue or null if it does not exist.
  */
 public function load($key)
 {
     $parameters = array('fields' => '', 'expand' => '');
     $response = $this->getCommunicationService()->get('issue/' . $key, $parameters);
     if ($response) {
         $response = GenericJiraObject::transformStdClassToGenericJiraObject($response);
         return new Issue($this, $response, TRUE);
     } else {
         return null;
     }
 }
Example #2
0
 /**
  * @param $rawIssues
  */
 private function parseAndAddIssues($rawIssues)
 {
     foreach ($rawIssues as $rawIssue) {
         $issue_data = GenericJiraObject::transformStdClassToGenericJiraObject($rawIssue);
         $this->issues[] = new Issue($this->issueService, $issue_data, false);
     }
 }
Example #3
0
 /**
  * Loads additional data from JIRA if this issue has not been fully loaded (e.g. sub task of loaded issue)
  */
 public function loadData()
 {
     if ($this->persistent && !$this->loaded) {
         if (!empty($this->key) || !empty($this->id)) {
             $key = $this->key;
             if (empty($key)) {
                 $key = $this->id;
             }
             $response = $this->issueService->getCommunicationService()->get('issue/' . $key);
             if ($response) {
                 $response = GenericJiraObject::transformStdClassToGenericJiraObject($response);
                 $this->merge($response);
                 $this->loaded = true;
             }
         } else {
             // misconfigured object that is persistent, but does not have an id or key
             $this->persistent = false;
         }
     }
 }