Generating Table from Issue-Key-List
Hi Fidel,
I have a list of issues keys (key-1, key-2, key 3) and I'm woundering if its possible to transform this into a issue table using the copy parsed text to field function:
||Key||Summary|| |key-1|Summary 1| |key-2|Summary 2| |key-3|Summary 3|
Thank you Patrick
Comments (12)
-
repo owner -
reporter I want to use it to write a comment that is shown in the customer portal of Service Desk. Therefore it needs to be WIKI-Markup
-
repo owner This expression composes a table in wiki format containing linked issues:
"||Issue Key||Summary||\n" + toString(textOnIssueList(linkedIssues(), "|" + ^%{00015} + "|" + ^%{00000} + "|"), "\n")
replacing
linkedIssues()
with your issue list expression.Note that %{00015} is field code for Issue key, and %{00000} is field code for Summary.
-
reporter I store my list of issue keys in an ephemeral text field. So I tried the following but an parsing error is returnd:
"||Issue Key||Summary||\n" + toString(textOnIssueList(%{00061}, "|" + ^%{00015} + "|" + ^%{00000} + "|"), "\n\n")
Using this results in an empty list: "||Issue Key||Summary||\n" + toString(textOnIssueList(likedIssues(%{00061}), "|" + ^%{00015} + "|" + ^%{00000} + "|"), "\n\n")
-
repo owner Use this expression:
"||Issue Key||Summary||" + toString(textOnIssueList(issueKeysToIssueList(%{00061}), "\n|" + ^%{00015} + "|" + ^%{00000} + "|"), "")
-
reporter Works perfect: one last question o that topic:
As you can see I'm building two tables within one Comment. Is there a possibility to add a kind of if-cause to each of the tables? Of course, I could use twi post functions, but I would be happy If i could solve that with only a single post function..
-
reporter "Folgende Anfragen wurden verknüpft:\n" + "||Issue Key||Summary||\n" + toString(textOnIssueList(issueKeysToIssueList(%{00061}), "|" + ^%{00015} + "|" + ^%{00000} + "|"), "\n") + "\nFolgende Anfragen wurden automatisch erstellt:\n" + "||Issue Key||Summary||\n" + toString(textOnIssueList(issueKeysToIssueList(%{00098}), "|" + ^%{00015} + "|" + ^%{00000} + "|"), "\n")
-
repo owner Sorry, I don't understand what you mean by if-cause. Do you want to add each table to the comment only when certain conditions are meet? A different condition for each table?
-
reporter I want to achieve that no empty table is written. So: if %{00061} = null then do not write first table. if %{00098} = null then do not write second table.
-
repo owner Use this expression:
(count(issueKeysToIssueList(%{00061})) > 0 ? "Folgende Anfragen wurden verknüpft:\n" + "||Issue Key||Summary||\n" + toString(textOnIssueList(issueKeysToIssueList(%{00061}), "|" + ^%{00015} + "|" + ^%{00000} + "|"), "\n") : "") + (count(issueKeysToIssueList(%{00098})) > 0 ? "\nFolgende Anfragen wurden automatisch erstellt:\n" + "||Issue Key||Summary||\n" + toString(textOnIssueList(issueKeysToIssueList(%{00098}), "|" + ^%{00015} + "|" + ^%{00000} + "|"), "\n") : "")
-
reporter Perfect! Thank you!
-
reporter - changed status to resolved
- Log in to comment
Do you want it in HTML format?