assignee depending on custom field value

Issue #211 closed
FatimaM created an issue

Hi.Is it possible by post function to set Assignee filed value dependign on custom field value.For example field value System if its equal to A,then assignee user Adam.if B then assignee user Ted

Comments (16)

  1. FatimaM reporter

    tnanks for reply.In our case System field is cascading select .is there any difference in writing expression?we have conditions that if on this step the System is A or B then assign will be System administrator default member.If other values then Assignee will be the field Developer value.how to achieve this ?

  2. Fidel Castro Armario repo owner

    If second level of System is the one that contain values A or B, then use the following setting rules:

    (.*- A)Adam
    (.*- B)Ted
    (.*)%{nnnnn}
    

    If first level of System is the one that contain values A or B, then use the following setting rules:

    (A -.*)Adam
    (B -.*)Ted
    (.*)%{nnnnn}
    

    replacing nnnnn with the field code of Developer field. I'm supposing the Developer is a User Picker custom field.

  3. FatimaM reporter

    [(InternetBanking -.|T24 -.) and %{10318}='']System administartor [(InternetBanking -.|T24 -.) and %{10318}!=""]%{10318} [(.) and %{10316}=""]Developer [(.) and %{10316}!=""]%{10316}

    I have such condition Jira gives error The field Assignee will be set according to the evaluation of System against the following set of rules: [(InternetBanking -.|T24 -.) and %{10318}='' :: PARSE ERROR : Encountered "" at line 1, column 1. Was expecting one of: ]System administartor [(InternetBanking -.|T24 -.) and %{10318}!="" :: PARSE ERROR : Encountered "" at line 1, column 1. Was expecting one of: ]%{System administartor} [(.) and %{10316}="" :: LEXICAL ERROR : Lexical error at line 1, column 3. Encountered: "" (42), after : "."]Developer [(.) and %{10316}!="" :: LEXICAL ERROR : Lexical error at line 1, column 3. Encountered: "" (42), after : "."]%{Developer} This feature will be run as user in field Current user.

  4. Fidel Castro Armario repo owner

    If you use [ ] in a setting rule, you should only use a boolean expression (type 2 setting rules). I think that you are mixing type 1 and type 2 syntax in a single setting rule.

    Empty string syntax is "", but you can use also null.

    For checking regular expression matching in boolean expressions (type 2 setting rules) use function matches(). Anyway, for evaluating cascading select fields using boolean expressions is better to use %{nnnnn.0} and %{nnnnn.1} for referencing each part of the composed value, replacing nnnnn with the corresponding field value of the cascading select custom field.

    I'm not sure what you intend to do with your setting rules, but a correct syntax would be:

    [%{nnnnn.0} in ["InternetBanking", "T24"] and %{10318} = null]System administrator
    [%{nnnnn.0} in ["InternetBanking", "T24"] and %{10318} != null]%{10318}
    [%{10316} = null]Developer
    [%{10316} != null]%{10316}
    

    Don't forget to replace nnnnn with the field code of cascading select field System.

    Beware to write the names of the project roles exactly and respecting the case.

  5. FatimaM reporter

    I change the value of system to other tham Internet Banking and T24 it assign the issue again to System administator

  6. Fidel Castro Armario repo owner

    Can you please attach a screenshot of the post-function's tab in your transition? I won't to see all the post-function you are executing and their order of execution.

  7. Fidel Castro Armario repo owner

    Please do the following changes in order to debug your setting rules:

    1. Set target field with "New comment".
    2. Replace the value part of your setting rules with a text indicating the setting rules that is being activated. Something like:
    [%{nnnnn.0} in ["InternetBanking", "T24"] and %{10318} = null]Rule_1
    [%{nnnnn.0} in ["InternetBanking", "T24"] and %{10318} != null]Rule_2
    [%{10316} = null]Rule_3
    [%{10316} != null]Rule_4
    

    Then checking up the comments created, you can find out whether the correct rule is activated in each case.

  8. Fidel Castro Armario repo owner

    Then the only explanation I can find is that default user for project roles "System administartor" and "Developer" in the project are the same. Is it possible?

    How have you defined default user for project role in the project?

  9. Fidel Castro Armario repo owner

    Can we have a screen share by Skype? I would like to see the failure in direct. My user is "fidel100r.

  10. Log in to comment