Set field using a conditional expression in a post-function

Issue #62 resolved
Pierre-Jean Constant created an issue

Hello,

Do you think it should be possible to have a post-function to build expression like this one :

If Customfield_xxx == A Customfield_yyy = X Else if (Customfield_xxx == B Or Customfield_xxx != C) Customfield_yyy = Y Else Customfield_yyy = W End

Thx in advance for your answer.

Comments (5)

  1. Fidel Castro Armario repo owner

    That functionality is currently implementable using post-function "Set a field as a function of other fields" using the following configuration:

    Captura de pantalla 2014-08-04 a la(s) 17.15.42.png

    For readability I copy here the 3 setting rules used:

    [%{12302}="A"]X

    [%{12302}="B" or %{12302}!="C"]Y

    [true]W

    Notice that:

    • I assume that fields "X" and "Y" contain text values. In case these fields are of type Number or Date-Time you should use its numeric value, i.e., you should use field codes without '%' prefix: {12302}
    • In boolean expressions we use double quotes to write literal string values, in case fields "X" and "Y" are of type Number or Date-Time, you should write literal numeric or date-time values without double quotes, e.g., 25.1 or 2014/08/04 17:30.
    • Parameter "Field to be checked for matching..." isn't used in this configuration, since we are only using type 2 setting rules, and that parameter is meant to be used in type 1 setting rules.

    Once configured, post-function will look like this: Captura de pantalla 2014-08-04 a la(s) 17.15.55.png

  2. Fidel Castro Armario repo owner

    I close this issue. Please, reopen it if you are not able to implement the proposed solution.

  3. Marcos Sciarra

    Fidel, Hay alguna forma de realizar lo siguiente:

    IF (summary = {vacio} AND CustomField(A)!={vacio}) THEN summary := CustomField(A)

    Muchísimas Gracias desde Argentina!

    Marcos

  4. Fidel Castro Armario repo owner

    Use "Set field as a function of other fields" with the following configuration:

    conf-1.png

    Note that:

    • %{00000} is field code for "Summary"
    • %{12800} is field code for custom field A in my JIRA instance. Custom field's codes depends on each particular JIRA instance.

    Once configured, "Create Issue" transition will look like this:

    conf-2.png

    Saludos desde España,

    Fidel

  5. Log in to comment