Make screenshot mandatory and get users in groups / role
Hi everyone,
I am working on a workflow that controlls how new tickets are created and would like to make it mandatory, that a screenshot is inserted. I found a way for custom fields (ctx.issue.fields.required), but i have no idea how to check if the user has inserted a screenshot.
And secondly i want to add all users of a group / specific role to the watchlist but did not find a way to get the groups or roles of a project.
Any tips are welcome how to solve these two tasks!
Thanks and have a great weekend,
Bastian
Please sign in to leave a comment.
Hi!
I'm Sergey from the YouTrack team.
If you are not familiar with the workflow functionality, I may suggest starting with our tutorial.
As for attachments, we have a ready-to-use workflow that does a similar thing, so you can use it as a basis.
As for groups, you can use a
findByName()method of a UserGroup entity:entities.UserGroup.findByName('Test Group'). A project team is accessible directly from a Project entity. A role can be retried from a User entity. It also haswatchIssue()method that you can use.A list of all workflow API entities with their properties and methods is also available in the workflow documentation (see the sidebar).
If you have any questions, please let me know.