0

I'm using /api/issues/{issueID}/activities to try and view the past changes for the State field of issues on YouTrack.

I'm able to see the time changes were made and the user that made them, but when I try to access added or removed value which are supposed provide the State value that was added/removed it only returns {'$type': 'StateBundleElement'} rather than the actual value e.i. "Open", "In Progress", "Closed", etc. Anyone know what to do?

https://www.jetbrains.com/help/youtrack/devportal/resource-api-issues-issueID-activities.html#ActivityItem-supported-fields

1 Answer 1

0

You also need to provide fields you want to see for a returned entity. Here is the list of fields for StateBundleElement. For example, the request GET api/issues/DEMO-1/activities?categories=CustomFieldCategory&fields=timestamp,author(login),added(name),removed(name),category returns

[
    {
        "removed": [
            {
                "name": "Submitted",
                "$type": "StateBundleElement"
            }
        ],
        "added": [
            {
                "name": "Open",
                "$type": "StateBundleElement"
            }
        ],
        "timestamp": 1577923200000,
        "category": {
            "$type": "ActivityCategory"
        },
        "author": {
            "login": "root",
            "$type": "User"
        },
        "$type": "CustomFieldActivityItem"
    },
    {
        "removed": null,
        "added": 1592654400000,
        "timestamp": 1593356400000,
        "category": {
            "$type": "ActivityCategory"
        },
        "author": {
            "login": "Demo.User",
            "$type": "User"
        },
        "$type": "CustomFieldActivityItem"
    },
    {
        "removed": 1592654400000,
        "added": 1592740800000,
        "timestamp": 1593445767000,
        "category": {
            "$type": "ActivityCategory"
        },
        "author": {
            "login": "Demo.User",
            "$type": "User"
        },
        "$type": "CustomFieldActivityItem"
    },
    {
        "removed": 1592654400000,
        "added": null,
        "timestamp": 1593445767000,
        "category": {
            "$type": "ActivityCategory"
        },
        "author": {
            "login": "Demo.User",
            "$type": "User"
        },
        "$type": "CustomFieldActivityItem"
    },
    {
        "removed": [
            {
                "name": "Open",
                "$type": "StateBundleElement"
            }
        ],
        "added": [
            {
                "name": "In Progress",
                "$type": "StateBundleElement"
            }
        ],
        "timestamp": 1703002756610,
        "category": {
            "$type": "ActivityCategory"
        },
        "author": {
            "login": "root",
            "$type": "User"
        },
        "$type": "CustomFieldActivityItem"
    }
]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.