About "isInGroup" function of "Condition based on JQL query" function.

Issue #129 resolved
Ricksoft Co., Ltd. created an issue

Hi I am currently evaluating "JIRA Workflow Toolbox" plugin. I see the following page.

Parser's Syntax Specification https://bitbucket.org/fcarmario/jira-workflow-toolbox/wiki/others/Parser

I am attempting to using "isInGroup" function of "Condition based on JQL query" function.

I want to make the following condition.

<condition>

If Group of Assignee is the same as Group of Current user , Current user can execute transition.

Please tell me good idea.

I look forward to hearing from you. Sincerely

kiyoshi kawama

Comments (5)

  1. Fidel Castro Armario repo owner

    Hi Kiyoshi,

    As you know, a user can be belong to more than one group. I suppose that you are trying to find out whether both users (assignee and current user) belong to a same group among a subset of significant groups in JIRA. Let's suppose that these significant groups are "Group A", "Group B", "Group C" and "Group D".

    In that case you should use "Boolean condition with math, date-time or text-string terms" with the following configuration:

    conf-1.png

    Boolean expression used is:

    isInGroup(%{00020}, "Group A") AND isInGroup(%{00003}, "Group A") OR isInGroup(%{00020}, "Group B") AND isInGroup(%{00003}, "Group B") OR isInGroup(%{00020}, "Group C") AND isInGroup(%{00003}, "Group C") OR isInGroup(%{00020}, "Group D") AND isInGroup(%{00003}, "Group D")

    Note that:

    • %{00003} is field code for Assignee.
    • %{00020} is field code for Current user.

    You can extend trivially this solution to as many groups as you need.

  2. Ricksoft Co., Ltd. reporter

    Hi, Thanks for your email.

    As you know, a user can be belong to more than one group. I suppose that you are trying to find out whether both users (assignee and current user) belong to a same group among a subset of significant groups in JIRA. Let's suppose that these significant groups are "Group A", "Group B", "Group C" and "Group D".

    isInGroup(%{00020%},"Group A") AND isInGroup(%{00030%},"Group A") OR isInGroup(%{00020%},"Group B") AND isInGroup(%{00030%},"Group B") OR isInGroup(%{00020%},"Group C") AND isInGroup(%{00030%},"Group C") OR isInGroup(%{00020%},"Group D") AND isInGroup(%{00030%},"Group D")

    I understood above-mentioned contents.

    But, As Group increase,I must fix transition.

    Please tell me alternative idea.

    If alternative idea is not,Please you consider this case as function enhancement in future.

    Sincerely

    kiyoshi kawama

  3. Fidel Castro Armario repo owner

    Hi Kiyoshi,

    The thing is that you must inform somehow the workflow that a new significant group has been created, since in your JIRA instance there may be many groups that shouldn't be considered for the condition, e.g., jira-users which is a group most users belong to.

    In your case, is there any characteristic or pattern that might be used to identify that a group is significant for the condition, i.e., is there some way to know whether a group should be considered or discarded by the condition, even before the group has been created?

    Regards,

    Fidel

  4. Fidel Castro Armario repo owner

    Hi Kiyoshi,

    Any news about this issue? Please, close the issue if you resolved it by your own means.

    Regards,

    Fidel

  5. Log in to comment