Set a field as a value of another field post function

Issue #823 resolved
Joseph Pursel
created an issue

Hi Fidel,

I have a use case to assign an issue in a Create Issue post function based on the type of business the reporter selects as shown below. I have 45+ different businesses and owners, of which several owners have multiple businesses. I am only showing the first three.

(Amazon Lending)purselj (Amazon Marketplace Web Services)userd (Amazon Pay)usere

In addition, I have the use case to override the rules in the post function with three separate conditions. If the only selected marketplace is either Japan or China or India, then the issue is to be assigned to a specific user for that country.

So, I used the following code in the Set a field as a function of another field on top of the 45+ business and owner rules as shown below. However, the issue is not created when I click Create. No warning message is produced, no indication that is not going to create the issue. Field code 12442 is a dynamic check box (multi select multi choice) field with 14 countries. The field name is Impacted Marketplaces.

(numberOfSelectedItems %{%{12442}} =1 AND %{12442} = "Japan")usera (numberOfSelectedItems %{%{12442}} =1 AND %{12442} = "China")userb (numberOfSelectedItems %{%{12442}} =1 AND %{12442} = "India")userc (Amazon Lending)purselj (Amazon Marketplace Web Services)usera (Amazon Pay)userc

How can I combine these two sets of rules in a post function to set the assignee according to the rules?

Thank you for helping me, Joe

Comments (2)

  1. Fidel Castro Armario repo owner

    Hi @Joseph Pursel,

    The correct syntax for your setting rules is:

    [numberOfSelectedItems(%{12442}) = 1 AND %{12442} = "Japan"]usera
    [numberOfSelectedItems(%{12442}) = 1 AND %{12442} = "China"]userb
    [numberOfSelectedItems(%{12442}) = 1 AND %{12442} = "India"]userc
    (Amazon Lending)purselj
    (Amazon Marketplace Web Services)usera
    (Amazon Pay)userc

    but you can simplify it to

    [%{12442} = "Japan"]usera
    [%{12442} = "China"]userb
    [%{12442} = "India"]userc
    (Amazon Lending)purselj
    (Amazon Marketplace Web Services)usera
    (Amazon Pay)userc
  2. Log in to comment