How do I use this plugin and log work programatically via the script runner?
Community moderators have prevented the ability to post new answers.
Hi,
We have REST services for the Log Work (by Roles) information. You can call POST service as mentioned below, and feed it the data as the format I give, which will log/update work for you on the roles of your choice.
You can read here, how to make REST calls from script runner : https://answers.atlassian.com/questions/314819
The PUT service is : {context path}/rest/adweb/2/logworkCF/worklogImport
The data you feed will be like the following :
{ "worklogroles": [ { "issueKey": "JT-2", "roleId": 10000, "worklogId": 0, "worklogAuthor": "admin", "timeSpent": 21600, "startDate": "Wed Mar 30 18:07:00 IST 2016", "worklogDesc": "" }, { "issueKey": "JT-3", "roleId": 10001, "worklogId": 0, "worklogAuthor": "admin", "timeSpent": 120, "startDate": "Wed Mar 30 18:08:00 IST 2016", "worklogDesc": "" } ] }
Here you can see, you can have as many number of worklogs you want.
Here you should note that "worklogId" is 0, which will create a new worklog, but if you want to update an existing logwork, you can provide a logwork id there.
The time spent is in seconds.
The startDate format should be in the format : "EEE MMM dd hh:mm:ss zzz yyyy".
I hope this should help you.
Please let us know if you face any trouble in this or if you have any further queries.
Thanks,
Abhinav.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.