Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allows for "expand" option in search requests #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Jira/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,11 @@ public function createIssue($projectKey, $summary, $issueType, $options = array(
* @param int $startAt
* @param int $maxResult
* @param string $fields
* @param string $expand
*
* @return Result|false
*/
public function search($jql, $startAt = 0, $maxResult = 20, $fields = '*navigable')
public function search($jql, $startAt = 0, $maxResult = 20, $fields = '*navigable', $expand = null)
{
$result = $this->api(
self::REQUEST_GET,
Expand All @@ -453,6 +454,7 @@ public function search($jql, $startAt = 0, $maxResult = 20, $fields = '*navigabl
'startAt' => $startAt,
'maxResults' => $maxResult,
'fields' => $fields,
'expand' => $expand,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better not to rely on fact, that http_build_query is used in used in underlying client class and do the following:

  1. move out the parameter array into a separate variable
  2. add an IF statement that would check for isset($expand) and only then add array entry
  3. use that array in ->api call

)
);

Expand Down