Workitem values missing from API call

When fetching workitems for test cases, some values were missing from the response. This is not the case for all workitems, but out of 33 workitems 16 were missing the workitem values listed below:

"workitem_key": "",
"workitem_status": "",
"workitem_status_category": "",
"workitem_summary": "", 

Here is the “POST” request I used:
https://app.testiny.io/api/v1/testcase/find

{
  "filter": { "project_id": 1 },
  "includeTotalCount": true,
  "map": [
    {
        "entities": ["testcase", "testrun"],
        "filter": { "testrun_id": [394, 419] }
    },
    {
        "entities": ["testcase", "workitem"],
        "result": "workitem"
    }
  ]
}

Here is an example for one workitem response:

"workitem": {
    "id": 82934,
    "is_deleted": false,
    "created_at": "2024-08-14T14:48:19.380Z",
    "created_by": 8299,
    "modified_at": "2024-08-14T14:48:19.380Z",
    "modified_by": 8299,
    "deleted_at": null,
    "deleted_by": null,
    "project_id": 1,
    "integration_id": 2,
    "workitem_api_project_id": "12538",
    "workitem_api_id": "1000540",
    "workitem_api_type_id": "10137",
    "workitem_key": "",
    "workitem_status": "",
    "workitem_status_category": "",
    "workitem_summary": "",
    "workitem_integration_type": "jira",
    "workitem_info": null
},

Hi,

In the other post I should have explained that the data from Jira (or any other integration supported via API) is not automatically synced. (I’ll add the info in the other post as well.)

To fetch data that is stored in Jira (that is the key, status, summary,…), you can execute the following request:

# integration_id from Testiny
# project_id from Testiny
# ids are the workitem ids from Testiny (pass multiple ids at once to reduce number of requests)
GET /workitem-integration/workitems?integration_id=123&project_id=1&sync=true&ids=10,11,12,13

This request fetches the work items with the specified ids and also fetches the information from the Jira API in the background. This request returns the up-to-date information from Jira (like status and summary).

So, if, for example, you fetch a test case and its linked requirements (as described in this post), you can continue working with the data in two ways (depending on your use case):

  1. Fetch the Jira issue data via the above request using Testiny’s workitem ids
  2. Or fetch the Jira issue data via the Jira API using the Jira issue ID (which is the workitem_api_id in Testiny) (or do any other action available in the Jira API)

I hope this solves your issue/use case and I’m sorry for the confusion.

If you can/want to share more information about your use case, we’re happy to assist you.

Best regards,
Hanna

I’m adding the workitem info to a post request I’m making to fetch test cases. Can I force the sync for this somehow as well?

This is the request I’m sending to testcase/find currently to get cases with workitem info.

{
  "pagination": {
      "offset": offset,
      "limit": limit,
  },
  "map": [
      {
          "entities": ["testcase", "workitem"],
          "result": "workitem",
      },
      {
          "entities": ["testcase", "testcase_folder"],
          "filter": {"testcase_folder_id": testcase_folder_ids},
          "result": "testcase_folder",
      },
  ],
  "includeTotalCount": True,
  "filter": {"project_id": project_id},
}

At the moment, there’s no way to sync the work items via the tescase/find API call.

If the work items have been synced before, the call returns this data but it might not be up to date (e.g. if title or status changed). To make sure you always receive up-to-date data, you need to do another request to /workitem-integration/workitems.

Best regards,
Hanna