I have some set of logic to be performed in a groovy script. This requires the postfunction name that is being currently used in the transition. Based on the postfunction name i need to perform some operations. How can we get the postfunction name and details programmatically? If i have 3 subtasks and subtask workflow has this particular postfunction by name "x'. I need to check if for all of the subtasks this postfunctions is initiated not
This sounds like you're asking the same as: https://answers.atlassian.com/questions/9372093
<span class="kwd">This sounds like a generic groovy language issue if I understand what you are requesting.</span>
<span class="kwd">import</span><span class="pln"> org</span><span class="pun">.</span><span class="pln">codehaus</span><span class="pun">.</span><span class="pln">groovy</span><span class="pun">.</span><span class="pln">runtime</span><span class="pun">.</span><span class="typ">StackTraceUtils</span><span class="pln"><br></span><span class="kwd">def</span><span class="pln"> getCurrentMethodName</span><span class="pun">(){</span><span class="pln"> </span><span class="kwd">def</span><span class="pln"> marker </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">Throwable</span><span class="pun">()</span><span class="pln"> </span><span class="kwd">return</span><span class="pln"> </span><span class="typ">StackTraceUtils</span><span class="pun">.</span><span class="pln">sanitize</span><span class="pun">(</span><span class="pln">marker</span><span class="pun">).</span><span class="pln">stackTrace</span><span class="pun">[</span><span class="lit">1</span><span class="pun">].</span><span class="pln">methodName </span><span class="pun">}</span>
Its part of that question. I know by your answer to the question above that all postfunctions do get fired. But is it possible to get the name of the postfunction from the current issue which is in action?
Like we have getallworkflowactions by passing issue id.On the similar grounds do we have something similar to this for postfunction too. I havent come across so just wanted to know if there's something like this.
I can't think of any use for getting the name of the current post-function in the code. You already know the name because you're in the code already.
It looks like you're new here. Sign in or register to get started.