Update Worklog as different user

Mathias April 29, 2019

Hi,

I try to automate a simple task and automatically log some minutes to this task. Unfortunatly it logts the time to the user that triggers the task, not the assigned one.

I tried with this simple JQL statement

{
"update": {
"worklog" : [
{
"add": {
"timeSpent" : "{{issue.labels.get(6).split("_").last}}",
"comment" : "{{assignee}}",
"author" : { "name" : "{{assignee}}"},
"started": "{{now.minusDays(now.dayOfWeek()).plusDays(1)}}"
}
}

]
}

 

Sorry - the board killed my formatting.

 

any ideas?

 

 Thanks 

mathias

 

2 answers

1 accepted

0 votes
Answer accepted
Deleted user April 29, 2019

Hi Mattias,

Thanks for your question. I'm afraid it isn't possible to achieve what you're trying to do. The Jira API doesn't allow you to set the author field and it is based on who the logged in user is.

For your reference, we do have a log work action now which would also be easier than the above method.

Cheers,

Simeon [Automation for Jira]

Tom Thompson May 12, 2021

Wow, that's not cool.  Can't do it in JSON either?

1 vote
Mathias April 30, 2019

Thanks for your answer simon. I found the log work function but it has its limitations. 

But if I cant log work as a different user right now I have to skip that automation - would be pointless automatically log work on the user that runs or created the rule

Thank you.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events