AutoIDM / tap-zohosprints

1 stars 0 forks source link

Add Discovery with custom fields #5

Open visch opened 3 years ago

visch commented 2 years ago

This has been painful, created some custom fields trying to work through this via the API here's my own notes

ZohoSprints allows for Custom Fields, to get this data via the API a query like this works https://sprintsapi.zoho.com/zsapi/team/758947948/projects/114398000000003959/item/no-3/?action=details

In the itemprop section of this response the custom fields are UDF_CHAR2, and UDF_RELEASE1

    "item_prop": {
        "endDate": 25,
        "description": 1,
        "isNotesAdded": 7,
        "itemNo": 2,
        "ownerId": 32,
        "addedVia": 15,
        "hasCheckList": 17,
        "leftPosition": 5,
        "points": 28,
        "duration": 30,
        "itemName": 0,
        "startAfter": 23,
        "createdTime": 11,
        "isIntegrated": 16,
        "rightPosition": 6,
        "rootItem": 19,
        "isDocsAdded": 9,
        "UDF_CHAR2": 31,
        "projPriorityId": 24,
        "isParent": 8,
        "UDF_RELEASE1": 29,
        "completedDate": 12,
        "sequence": 10,
        "sprintId": 20,
        "depth": 4,
        "epicId": 22,
        "statusId": 27,
        "createdBy": 3,
        "parentItem": 18,
        "projItemTypeId": 21,
        "completedBy": 14,
        "startDate": 26
    },

Querying the itme through the full list of items using https://sprintsapi.zoho.com/zsapi/team/{{teamId}}/projects/{{projectId}}/sprints/114398000000003987/item/?action=sprintitems&index=1&range=25

Doesn't list the custom fields in the response anywhere.

Scope to use: ZohoSprints.projects.READ, ZohoSprints.teams.READ, ZohoSprints.items.READ, ZohoSprints.epic.READ, ZohoSprints.sprints.READ

visch commented 2 years ago

In the hunt for the best way to get custom field values

https://sprintsapi.zoho.com/zsapi/team/{{teamId}}/projects/{{projectId}}/sprints/114398000000003987/item/?action=sprintitems&index=1&range=100

(https://sprints.zoho.com/apidoc.html#Getmultipleitemdetails) doesn't work either. You can pass in any number of ITEM ids, but item props doesn't include custom information

    "item_prop": {
        "endDate": 7,
        "description": 3,
        "isNotesAdded": 10,
        "itemNo": 17,
        "ownerId": 31,
        "addedVia": 5,
        "hasCheckList": 23,
        "leftPosition": 15,
        "points": 18,
        "duration": 20,
        "itemName": 1,
        "startAfter": 22,
        "createdTime": 19,
        "isIntegrated": 12,
        "rightPosition": 16,
        "rootItem": 25,
        "isDocsAdded": 11,
        "projPriorityId": 30,
        "isParent": 13,
        "completedDate": 8,
        "itemId": 0,
        "sequence": 2,
        "sprintId": 26,
        "depth": 14,
        "epicId": 24,
        "statusId": 28,
        "createdBy": 4,
        "parentItem": 27,
        "projItemTypeId": 29,
        "startDate": 6,
        "completedBy": 21
    },
visch commented 2 years ago

https://sprintsapi.zoho.com/zsapi/team/{{teamId}}/projects/{{projectId}}/?action=itemcfields Pulls the list of custom fields on the project, but still not enough (Documenting all of this as I keep trying in different ways to get this)

visch commented 2 years ago

Going to generate this for Items at a minimum to add the record object, related to the fix for #15

visch commented 2 years ago
visch commented 2 years ago

Going to use https://sdk.meltano.com/en/latest/code_samples.html#dynamically-discovering-schema-for-a-stream

Generate schema from a static list of fields, and add a list of fields from each projects custom field call https://sprintsapi.zoho.com/zsapi/team/{{teamId}}/projects/{{projectId}}/?action=itemcfields