Bug in parser

Issue #323 resolved
Andrey Kiyanovsky created an issue

Hi Fidel,

It seems like I found a bug in the parser.

The following function doesn't work:

toString(filterByPredicate(toStringList(projectProperty("IssueFlowComp_" + %{00014}),";"),^% ~ first(toStringList(toString(filterByPredicate(textOnStringList(textOnStringList(toStringList(projectProperty("IssueFlowComp_" + % {00014}),";"),replaceFirst(^%,"^.+:","")),toString(intersect(toStringList(^%,","),toStringList(%{00094},",")))),^% != "")),","))))

where

projectProperty("IssueFlowComp_" + %{00014}) = "SSL:Component1;Simple:Component3" Component(s) in the issue = "Component3"

returns "SSL:Component1;Simple:Component3" instead of "Simple:Component3".

After an investigation, I found that function filterByPredicate doesn't work. When I took out the second argument of filterByPredicate function into string, it started to work:

Ephemeral String 1 = first(toStringList(toString(filterByPredicate(textOnStringList(textOnStringList(toStringList(projectProperty("IssueFlowComp_" + %{00014}),";"),replaceFirst(^%,"^.+:","")),toString(intersect(toStringList(^%,","),toStringList(%{00094},",")))),^% != "")),","))

and

toString(filterByPredicate(toStringList(projectProperty("IssueFlowComp_" + %{00014}),";"),^% ~ %{00061}))

and returns "Simple:Component3", as expected.

JIRA 6.4.11 JWT 2.2.11

Best, AK.

Comments (3)

  1. Fidel Castro Armario repo owner

    Hi Andrey,

    Please, try the following text to be parsed, and let me know if it works as your expect:

    toString(filterByPredicate(toStringList(projectProperty("IssueFlowComp_" + %{00014}),";"),^0% ~ first(toStringList(toString(filterByPredicate(textOnStringList(textOnStringList(toStringList(projectProperty("IssueFlowComp_" + %{00014}),";"),replaceFirst(^1%,"^.+:","")),toString(intersect(toStringList(^1%,","),toStringList(%{00094},",")))),^1% != "")),","))))
    

    A tip: ^% is an alias for ^0%

  2. Andrey Kiyanovsky reporter

    Thank you, Fidel, it works! I see where the root cause was - references with nested operations.

  3. Log in to comment