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

Issue #909 resolved
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 (16)

  1. Benjamin C. John

    Hello @jcarlosmg81,

    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. JCarlos Account Deactivated reporter

    Ok thank you so much Benjamin.

    When do you think the next release will be available? This functionality is more important for us

  3. Benjamin C. John

    Hey @jcarlosmg81,

    at the moment we can not give you a date but it should be within the next two weeks, most probably earlier.

    Kind regards, Benjamin

  4. Athena 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

  5. Fidel Castro Armario repo owner

    Hi @apetridou,

    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.

  6. Athena Petridou

    Hey Fidel,

    Yes , but the "Run as " problem still persists. I will try your workaround but I don't think that will help me a lot.

    Thank you

  7. Athena 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?

  8. Fidel Castro Armario repo owner

    Hi @apetridou,

    Yes, it's normal. Current user is always written in the log output. In next version we will also add to the log file the user who is executing the action (I.e., the user in Run As parameter).

  9. Benjamin C. John

    Hi @jcarlosmg81,

    we are currently working on the release, it will be available in this week , sorry for the delay.

    Kind regards, Benjamin

  10. Log in to comment