go-jira / jira

simple jira command line client in Go
Apache License 2.0
2.67k stars 326 forks source link

IssueLinkType is missing the type value #348

Open peteraba opened 4 years ago

peteraba commented 4 years ago

This is the relevant part of a jira view call:

        "issuelinks": [
            {
                "id": "916738",
                "inwardIssue": {
                    "fields": {
                        "issuetype": {
                            "avatarId": 21748,
                            "description": "",
                            "iconUrl": "https://jira.mydomain.net/secure/viewavatar?size=xsmall\u0026avatarId=21748\u0026avatarType=issuetype",
                            "id": "11401",
                            "name": "User Story",
                            "self": "https://jira.mydomain.net/rest/api/2/issuetype/11401",
                            "subtask": false
                        },
                        "priority": {
                            "iconUrl": "https://jira.mydomain.net/images/icons/priorities/major.svg",
                            "id": "3",
                            "name": "Major",
                            "self": "https://jira.mydomain.net/rest/api/2/priority/3"
                        },
                        "status": {
                            "description": "",
                            "iconUrl": "https://jira.mydomain.net/images/icons/statuses/generic.png",
                            "id": "14521",
                            "name": "Breakdown",
                            "self": "https://jira.mydomain.net/rest/api/2/status/14521",
                            "statusCategory": {
                                "colorName": "yellow",
                                "id": 4,
                                "key": "indeterminate",
                                "name": "In Progress",
                                "self": "https://jira.mydomain.net/rest/api/2/statuscategory/4"
                            }
                        },
                        "summary": "Calendar Structure"
                    },
                    "id": "3709197",
                    "key": "ZSB-2696",
                    "self": "https://jira.mydomain.net/rest/api/2/issue/3709197"
                },
                "self": "https://jira.mydomain.net/rest/api/2/issueLink/916738",
                "type": {
                    "id": "10350",
                    "inward": "is child task of",
                    "name": "Child-Issue",
                    "outward": "is parent task of",
                    "self": "https://jira.mydomain.net/rest/api/2/issueLinkType/10350"
                }
            }
        ],

And this is the relevant part of IssueLinkType

type IssueLinkType struct {
    ID      string `json:"id,omitempty" yaml:"id,omitempty"`
    Inward  string `json:"inward,omitempty" yaml:"inward,omitempty"`
    Name    string `json:"name,omitempty" yaml:"name,omitempty"`
    Outward string `json:"outward,omitempty" yaml:"outward,omitempty"`
}

Seems to me, IssueLinkType needs another field called Type, although it is somewhat confusing given that this is a generated file....

peteraba commented 4 years ago

Just to clarify, this is not a blocker for me, I just found this by trying to parse an interface as an IssueLinkType, but it was a map[string]interface{} anyway. Feel free to close this if it's irrelevant.