Update parameters of the Set a field as a function of other fields Function for this transition.

Issue #193 resolved
Shehan Lena created an issue

I am uisng the 'Update parameters of the Set a field as a function of other fields Function for this transition.' I get that I need to use type 1: '('regular_expression')'value to extract the expression and then send the value in. At the moment it works fine if that value is hardcoded. It doesnt work when that value needs to be a variable as well. So for example in the description field, I have

Issue desc 12345. I want 12345 to be populated into another field. It will match the regex but I am unable to send in the 12345 after.

Does the value component support another regex?

Thanks, Shehan

Comments (5)

  1. Fidel Castro Armario repo owner

    Hi Stephan,

    I don't understand exactly what you intend to do, or which is your problem. Please, attach a screenshot with your current configuration of "Set a field as a function of other fields" post-function.

    One question:

    • When you say "I have Issue desc 12345", do you mean that your issue Description is "12345" or contains the substring "12345"?

    In the value component of the setting rule you can use a text to be parsed in advanced parsing mode, using the same syntax as we use in "Copy a parsed text to a field" post-function.

    To force the value part to be parsed in advanced mode simply add prefix 'A' to your setting rule, for example:

    A(someValue)"Number of linked issues is: " + count(linkedIssues())
    
  2. Shehan Lena reporter

    Hi Fidel Thanks for the reply. My Setting rules is :(.HEAT Reference:.)substring(%{Description},15,5) My target field is a reference field.

    The description in my email is HEAT Reference: 55555 Type: Service Request

    I want this to go through the description and match the phrase HEAT Reference: and then populate the reference field with 55555

    At the moment this cannot do that. The expression above does populate the reference but with substring(HEAT Reference: 55555 Type: Service Request,15,5). It cant seem to understand rgex expressions in the value

  3. Shehan Lena reporter

    I can see where I need to use Advanced parsing - that doesnt seem to work. A(.HEAT Reference:.)substring(%{Description},15,5) returns a(.HEAT Reference:.)substring(%{Description},15,5) :: LEXICAL ERROR : Lexical error at line 1, column 13. Encountered: "D" (68), after : "%{"

    When I save

  4. Fidel Castro Armario repo owner

    You should use the field code for Description which is %{00001}. When you save your configuration, field codes are replaced with their corresponding field names, which is what you are incorrectly using in the setting rule (e.g., %{Description}).

    On the other hand, you are not using correctly function substring(), since 2th argument should always be lower that 3th argument.

    Here I copy+paste the description of this function in the plugin's documentation:

    substring(string s, number beginIndex, number endIndex) : string

    Returns a substring of s beginning at index beginIndex and ending at endIndex - 1. Thus the length of the substring is endIndex-beginIndex.

    Example: substring("smiles", 1, 5) returns "mile".

  5. Log in to comment