Skip to content
Closed
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
49 changes: 49 additions & 0 deletions src/Jira/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,17 @@ public function editIssue($issue_key, array $params)
return $this->api(self::REQUEST_PUT, sprintf('/rest/api/2/issue/%s', $issue_key), $params);
}

/**
* Gets attachments meta information.
*
* @return array
* @since 2.0.0
*/
public function getAttachmentsMetaInformation()
{
return $this->api(self::REQUEST_GET, '/rest/api/2/attachment/meta');
}

/**
* Gets attachment.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't getAttachmentsMetaInformation already merged #101? Please remove from this diff

*
Expand Down Expand Up @@ -835,4 +846,42 @@ public function closeIssue($issue_key)
return $result;
}

/**
* Returns project components.
*
* @param string $project_key Project key.
*
* @return array|false
Copy link
Member

@aik099 aik099 Jun 17, 2016

Choose a reason for hiding this comment

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

In which cases the false gets returned?

I thought, that if project has no component, then I'll get empty array back. If there was an error I'll get an exception.

* @since 2.0.0
*/
public function getProjectComponents($project_key)
{
return $this->api(self::REQUEST_GET, sprintf('/rest/api/2/project/%s/components', $project_key), array(), true);
}

/**
* Get all issue types with valid status values for a project.
*
* @param string $project_key Project key.
*
* @return array
* @since 2.0.0
*/
public function getAllIssueTypes($project_key)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We already have a getIssueTypes who returns the global list. This one is specific for projects. Maybe rename to getProjectIssueTypes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree on everything above it will be corrected and committed asap.

{
return $this->api(self::REQUEST_GET, "/rest/api/2/project/{$project_key}/statuses", array(), true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use sprintf here as well

Copy link
Member

Choose a reason for hiding this comment

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

And single quotes.

}

/**
* Returns a list of all resolutions.
*
* @param string $project_key Project key.
*
* @return array|false
* @since 2.0.0
*/
public function getResolutions()
{
return $this->api(self::REQUEST_GET, "/rest/api/2/resolution", array(), true);
}
Copy link
Member

Choose a reason for hiding this comment

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

There must be an empty line after last function in a class.

Please configure CS check locally to see the issue.

}