mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-07-15 01:04:38 +02:00
Added support for the 'expand:renderfields' option
A couple of fields can be rendered server side, especially the ones related to dates (that can become string like "2 hours ago"), and the comments body that can be expanded from JIRA wiki markup into HTML. A new type IssueRenderedFields has been introduced with a couple of fields that can be expanded.
This commit is contained in:
30
issue.go
30
issue.go
@ -31,12 +31,13 @@ type IssueService struct {
|
||||
|
||||
// Issue represents a JIRA issue.
|
||||
type Issue struct {
|
||||
Expand string `json:"expand,omitempty" structs:"expand,omitempty"`
|
||||
ID string `json:"id,omitempty" structs:"id,omitempty"`
|
||||
Self string `json:"self,omitempty" structs:"self,omitempty"`
|
||||
Key string `json:"key,omitempty" structs:"key,omitempty"`
|
||||
Fields *IssueFields `json:"fields,omitempty" structs:"fields,omitempty"`
|
||||
Changelog *Changelog `json:"changelog,omitempty" structs:"changelog,omitempty"`
|
||||
Expand string `json:"expand,omitempty" structs:"expand,omitempty"`
|
||||
ID string `json:"id,omitempty" structs:"id,omitempty"`
|
||||
Self string `json:"self,omitempty" structs:"self,omitempty"`
|
||||
Key string `json:"key,omitempty" structs:"key,omitempty"`
|
||||
Fields *IssueFields `json:"fields,omitempty" structs:"fields,omitempty"`
|
||||
RenderedFields *IssueRenderedFields `json:"renderedFields,omitempty" structs:"renderedFields,omitempty"`
|
||||
Changelog *Changelog `json:"changelog,omitempty" structs:"changelog,omitempty"`
|
||||
}
|
||||
|
||||
// ChangelogItems reflects one single changelog item of a history item
|
||||
@ -196,6 +197,23 @@ func (i *IssueFields) UnmarshalJSON(data []byte) error {
|
||||
|
||||
}
|
||||
|
||||
// IssueRenderedFields represents rendered fields of a JIRA issue.
|
||||
// Not all IssueFields are rendered.
|
||||
type IssueRenderedFields struct {
|
||||
// TODO Missing fields
|
||||
// * "aggregatetimespent": null,
|
||||
// * "workratio": -1,
|
||||
// * "lastViewed": null,
|
||||
// * "aggregatetimeoriginalestimate": null,
|
||||
// * "aggregatetimeestimate": null,
|
||||
// * "environment": null,
|
||||
Resolutiondate string `json:"resolutiondate,omitempty" structs:"resolutiondate,omitempty"`
|
||||
Created string `json:"created,omitempty" structs:"created,omitempty"`
|
||||
Duedate string `json:"duedate,omitempty" structs:"duedate,omitempty"`
|
||||
Updated string `json:"updated,omitempty" structs:"updated,omitempty"`
|
||||
Comments *Comments `json:"comment,omitempty" structs:"comment,omitempty"`
|
||||
}
|
||||
|
||||
// IssueType represents a type of a JIRA issue.
|
||||
// Typical types are "Request", "Bug", "Story", ...
|
||||
type IssueType struct {
|
||||
|
Reference in New Issue
Block a user