Retrieve work item id in workflows
Hi,
is there any option to retrieve the id of a work item within a workflow?
According to the documentation of the YouTrack REST API work items do have an ID, but till now we weren't able to access the field within a workflow. Is there any chance to do so?
Please sign in to leave a comment.
Hi!
I'm Sergey from the YouTrack team.
No, that's not possible, I'm afraid. We have a related feature request in our public tracker: https://youtrack.jetbrains.com/issue/JT-67651/Provide-entity-IDs-in-a-workflow. Please feel free to vote for this issue. This helps us gauge how much impact this feature will have on our customer base, and you’ll also get subscribed to the issue’s notifications.
Just in case, you can send HTTP requests from a workflow, though.
Same problem here. Hopefully it will be implemented soon :)
We have the same problem.
We want to check whether a user is allowed to change a workItem (especially the duration). Unfortunately, the workItem attributes cannot be controlled via permissions. (It is not possible to set workitems to `isBilled` without not every user being able to change it again).
Because of that, we make a request to our external billing tool that checks whether workitems are set to billed. If it is already billed in the app, it can also no longer be changed in YT.
As we do not have access to the ID (in our APP we do, because we sync the workItems here via the API), we have to do it with an artificial ID from `hash(date+user)`. This works, but is very messy.
The ID should be available, as it probably only needs to be passed on in one place anyway.
The funny thing is that even the official jetbrain youtrack apps are running in the same issue in that code because they reference on a workItem.id which always return undefined and gets removed from the json automatically. So all the documentation of the webhook-triggers plugins are wrong because all the “id" fields are missing and so the whole official plugin makes no sense. So i thought you already find it necessary for plugin and even forgot that it is not implemented in the workflow engine. Could you please support it. I guess it won't take weeks to support the “id” fields here.