Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
philw66
Contributor III
Contributor III

TMC Cloud API - Get Task ID by name EXACT MATCH

Hi all,

 

Trying to use the GET TASK endpoint https://api.us.cloud.talend.com/tmc/v2.6/executables/tasks

We have several tasks with similar names. Is there a way to query for EXACT name match rather than filter which may return more than 1 record.

 

For example, we have tasks named:

myTask

myTask_part2

myTask_part3

 

Can I call the endpoint and have it return JUST the taskID for myTask ?

 

The workaround is that I have to take the multi-record output and strip out the extra records...

Thanks !

Labels (3)
4 Replies
anselmopeixoto
Partner - Creator III
Partner - Creator III

Hi @Phil Wang​ 

 

Perhaps you can use the search resource:

 

https://api.us.cloud.talend.com/tmc/swagger/swagger-ui.html#/tasks/searchTasks

cthalikota1688057318
Contributor
Contributor

Hi @Anselmo Peixoto​ 

 

Using ArtifactId in post method would force to do the exact match. The same could be achievable through https://api.us.cloud.talend.com/tmc/v2.6/executables/tasks.

 

Mr @Phil Wang​ was keen about doing exact match based on task name, workspace & environment.

anselmopeixoto
Partner - Creator III
Partner - Creator III

Hi @chaitanya thalikota​ / @Phil Wang​ 

 

I'm not sure if all the arguments are mandatory for search resource and unfortunately I cannot try it right now.

 

Did you try using only task name, workspace and environment?

 

{

"name": "myTask",

"environmentId": "6148511d6ccc6d41563574e5",

"workspaceId": "614851d46ccc6d41563574ea",

}

 

philw66
Contributor III
Contributor III
Author

Hi @Anselmo Peixoto​ ,

 

Thank you for your suggestion. Unfortunately, using environmentid, workspaceid, and task name does not provide an exact match but a filter using the name just like the original endpoint...

 

using

{

"name": "myTask",

"environmentId": "6148511d6ccc6d41563574e5",

"workspaceId": "614851d46ccc6d41563574ea",

}

 

I am still getting results that include myTask, myTask_part1, myTask_part2