Run as administrator not working in post function "Create issues and subtasks"

Issue #909 open
JCarlos
created an issue

I have a post funcion in a Epic Issue. This post function creates a new Issue and add a link to the epic and set other two fields.

When post function runs, in the History of the new issue creates, appears current user and not administrator. This causes errors because the current user doesn't have the necessary permissions

Can you help me? why not appears administrator like user who runs postfunction?postfunction.PNG

Thanks

Comments (13)

  1. Benjamin C. John [DECADIS AG]

    Hello @JCarlos,

    thank you for reporting this issue. This is a bug and not a configuration problem. We will provide a Bug Fix for this issue in our next release. After the fix the creator of the issue will be the acting user as selected in the configuration of the post function.

    Kind Regards, Benjamin

  2. Athina Petridou

    Hey there,

    I just found out about this issue, because I am experiencing the same problem but with some differences.

    In my case, I use an administrator on the "Run As" component of the "Write fields on linked issues or subtasks". Thing is, that even though on Issue's history, the right user is shown, on logs it seems that the post function runs as the current user. Also it seems that when there is a global transition that the user has permissions on then the post function uses that transition instead of the desired one.

    Reproduction steps: Capture.PNG 1. On the Escalate transition we added a Create Issue post function (on the same project with the same workflow) 2. On the Info Provided we added a condition "Transition is triggered by JIRA Workflow Toolbox post-function by JWT" 3. On Done transition we added the "Write field on linked issues or subtasks" in order to trigger the transition "Info Provided" with "Run As" an automation user with admin privileges. 4. When a user executes the Done transition the logs are these: 2017-12-11 13:45:17,344 http-nio-8080-exec-7 DEBUG apetridou2 825x5247x1 huneu1 2.86.206.63,192.168.1.90 /secure/WorkflowUIDispatcher.jspa [c.f.j.p.workflowToolbox.shared.AbstractValidator] FIELD Issue status IN ISSUE JETI-52 HAS BEEN WRITTEN WITH VALUE "In Progress". 2017-12-11 13:45:17,344 http-nio-8080-exec-7 DEBUG apetridou2 825x5247x1 huneu1 2.86.206.63,192.168.1.90 /secure/WorkflowUIDispatcher.jspa [c.f.j.p.workflowToolbox.shared.IssueTransitionManager] UNBLOCKED ISSUE JETI-52; BLOCKED ISSUES SIZE: 0 2017-12-11 13:45:17,344 http-nio-8080-exec-7 DEBUG apetridou2 825x5247x1 huneu1 2.86.206.63,192.168.1.90 /secure/WorkflowUIDispatcher.jspa [c.f.j.p.workflowToolbox.shared.IssueTransitionManager] TRANSITION "Send Mail" ON ISSUE JETI-52 HAS BEEN EXECUTED SUCCESSFULLY. 2017-12-11 13:45:17,275 http-nio-8080-exec-7 DEBUG apetridou2 825x5247x1 huneu1 2.86.206.63,192.168.1.90 /secure/WorkflowUIDispatcher.jspa [c.f.j.p.workflowToolbox.shared.IssueTransitionManager] OPERATION: PROCESS; MODE: PEEK JETI-52; INITIAL SIZE: 0; FINAL SIZE: 0; RETURNED: null

    You can see here that the "Send Mail" transition is triggered instead of the "Info Provided" one. But in Issue's History nothing changed: Capture2.PNG

    Do you have any news regarding the bug fix release? Thank you, Athina

  3. Fidel Castro Armario repo owner

    Hi @Athina Petridou,

    Thank you for reporting this bug. We will fix it in next version of the add-on. Nevertheless you can apply a the following fix using your current version of JWT:

    Now you are writing "In Progress" value into virtual field "Issue status" or "Issue status (delayed writing)". Instead of that you can write "Info Provided" into virtual field "Execute transition " or "Execute transition (delayed execution)".

    With this solution we are forcing to execute the desired transition instead of leaving the decision to JWT.

  4. Athina Petridou

    Hey again,

    So I tried your workaround and it works. But I can see again in logs that the user who executes the transition is not my "automation user" that I specified on the post function

    2017-12-12 11:03:31,520 http-nio-8080-exec-22 DEBUG apetridou2 663x30710x1 mb4u5x 2.86.206.63,192.168.1.90 /secure/WorkflowUIDispatcher.jspa [c.f.j.p.workflowToolbox.shared.AbstractValidator] *** FIELD Execute transition IN ISSUE JETI2-8 HAS BEEN WRITTEN WITH VALUE "Info Provided".

    Although, on Issue's history, the user that shows up is "Automation User" Capture.PNG

    Is this normal?

  5. Log in to comment