How do I get all available tags in a workflow rule?
I am creating a workflow rule, and I would like to see if a tag exists in the current project with a certain name. There doesn't seem to be a way to do this. The closest I can come is this:
var tag = loggedInUser.getSharedTag(word);
if( tag == null ) {
tag = project.getUser("root").getSharedTag(word);
}
if( tag == null ) {
tag = loggedInUser.getTag(word, false);
}
if( tag == null ) {
tag = project.getUser("root").getTag(word, false);
}
if(tag == null) {
message("no tag found for " + word);
} else {
message("tag FOUND for " + word);
}
But this will miss tags created by other users. project.valuesFor(tags) doesn't work, as it doesn't see tags as a field.
What am I missing here?
var tag = loggedInUser.getSharedTag(word);
if( tag == null ) {
tag = project.getUser("root").getSharedTag(word);
}
if( tag == null ) {
tag = loggedInUser.getTag(word, false);
}
if( tag == null ) {
tag = project.getUser("root").getTag(word, false);
}
if(tag == null) {
message("no tag found for " + word);
} else {
message("tag FOUND for " + word);
}
But this will miss tags created by other users. project.valuesFor(tags) doesn't work, as it doesn't see tags as a field.
What am I missing here?
Please sign in to leave a comment.
If you want to get tags of users of some group you can iterate by users:
for each user in {group: New Users}.getUsers() { user.getTag("word", false); }