shanehofstetter / youtrack-rest-client

youtrack REST API client written in typescript
https://www.npmjs.com/package/youtrack-rest-client
MIT License
38 stars 21 forks source link

Values of TextIssueCustomField are not returned #18

Open andreasciamanna opened 3 years ago

andreasciamanna commented 3 years ago

When fetching an issue with a TextIssueCustomField custom field, the text or markdown value of that field is not returned.

I only get that:

...
 "value": {
        "id": "text",
        "$type": "TextFieldValue"
      },
      "name": "Failed builds",
      "id": "220-679",
      "$type": "TextIssueCustomField"
    }

When fetching the same issue via GET request, I get the full value:

...
      "value": {
        "id": "text",
        "markdownText": "**SOME HTML**",
        "text": "**SOME TEXT**",
        "$type": "TextFieldValue"
      },
      "name": "Failed builds",
      "id": "220-679",
      "$type": "TextIssueCustomField"

In src/entities/issueCustomField.ts, it seems that, at least the "text" property must be returned, which is strange:

export class IssueCustomFieldValueImpl {
    id?: string = '';
    name?: string = '';
    localizedName?: string = '';
    fullName?: string = '';
    login?: string = '';
    avatarUrl?: string = '';
    isResolved?: boolean = false;
    color?: FieldStyle = new FieldStyleImpl();
    text?: string = '';
}

I just call youtrack.issues.byId(someId).then((issue) => { ....

For now, I have to resort to using a plain GET request because I can't figure out what I'm doing wrong.

shanehofstetter commented 3 years ago

Hi @andreasciamanna, I just noticed that the text property was added only recently which was not included in v1.3.2, I just published a new version 1.4.0 - please try updating it and see if it fixes the issue.