Setting absences using the Server Side API
Hi all,
Is there a way to set an absence using the Server Side API? It is surely possible to achieve this using some internal client libraries but it seems that this cannot be done by the Server API .
I´ve already read this:
https://jazz.net/forum/questions/37634/accessing-the-time-zone-of-usercontributor-of-a-work-item
This:
https://rsjazz.wordpress.com/2012/12/09/analyzing-a-aroject-areas-members-and-roles-using-the-plain-java-client-libraries/
And this:
https://jazz.net/forum/questions/103798/is-there-any-solutions-for-saving-or-getting-users-absence-information-using-api-of-server-side-rtc
And quite a lot more so I would really appreciate your help or guidance.
Thanks in advance,
Francisco R.
Accepted answer
I found a way from AbstractService, to at least get at the data.
You can get the handle for IContributorRecord which is a class that provides all the data, including the details, which include the absences. This might be another way through the server API.
You can get the handle for IContributorRecord which is a class that provides all the data, including the details, which include the absences. This might be another way through the server API.
Comments
showing 5 of 11
show 6 more comments
2 other answers
The only API I am aware of is described here: http://rsjazz.wordpress.com/2014/07/22/manage-scheduled-absences-using-the-plainjava-client-libraries/
If you look for references to any of the classes used or for "ResourcePlanning" you will notice that there are only references to com.ibm.apt.*.common and com.ibm.apt.*.client and that there is no service (at least I could find) for this.
Common api is for client and server, however, all I was able to find are the resource model classes. No common service.
If you find something, let me know.
@Sam, as far as I know, the WebUI uses the client API.
If you look for references to any of the classes used or for "ResourcePlanning" you will notice that there are only references to com.ibm.apt.*.common and com.ibm.apt.*.client and that there is no service (at least I could find) for this.
Common api is for client and server, however, all I was able to find are the resource model classes. No common service.
If you find something, let me know.
@Sam, as far as I know, the WebUI uses the client API.
Comments
showing 5 of 7
show 2 more comments
Hy Francisco,
I've found out how you can do it with the ServerSide API.
Hopefully I didn't meant something different.
But here's my solution:
First you have to require the needed Class:
dojo.require("com.ibm.team.apt.web.client.internal.ResourcePlanningClient");
If you wanna see the class watch it here:
"installs\rtc-sdk\plugins\com.ibm.team.apt.web.client_3.0.800.v20131025_0417\resources\internal"
In RTC 4.0.5
There you can see the different parameters you could use.
So on... you have to set up a serviceResponseHandler.
var serviceObjectSprints = {
self: this, //This you don't really need. But in this way you could iteract with the viewlet [this.self.test()]
success: function(page) {
},
failure: function (error) {
}
}
var srh = new ServiceResponseHandler(serviceObjectSprints, "success", "failure");
var args = {
addedAbsences: { "description": "nameOfAbsence",
"startDate": "ISO String",
"endDate": "
};
ResourcePlanningClient.postAbsences(srh, args);
To be honest, I didn't tryed it out.... but this is the key ;)
If it won't work, I gonna try it for you if you want.
I've found out how you can do it with the ServerSide API.
Hopefully I didn't meant something different.
But here's my solution:
First you have to require the needed Class:
dojo.require("com.ibm.team.apt.web.client.internal.ResourcePlanningClient");
If you wanna see the class watch it here:
"installs\rtc-sdk\plugins\com.ibm.team.apt.web.client_3.0.800.v20131025_0417\resources\internal"
In RTC 4.0.5
There you can see the different parameters you could use.
So on... you have to set up a serviceResponseHandler.
var serviceObjectSprints = {
self: this, //This you don't really need. But in this way you could iteract with the viewlet [this.self.test()]
success: function(page) {
},
failure: function (error) {
}
}
var srh = new ServiceResponseHandler(serviceObjectSprints, "success", "failure");
var args = {
addedAbsences: { "description": "nameOfAbsence",
"startDate": "ISO String",
"endDate": "
2014-07-24T00:00:00+02:00" //This is an ISO-String
},
contributorId: //The ID of the user you wanna add the absence
};
ResourcePlanningClient.postAbsences(srh, args);
To be honest, I didn't tryed it out.... but this is the key ;)
If it won't work, I gonna try it for you if you want.
Comments
sam detweiler
Jul 23 '14, 7:27 p.m.Francisco Rodriguez
Jul 23 '14, 8:38 p.m.sam detweiler
Jul 23 '14, 8:45 p.m.Jonas Studer
Jul 24 '14, 5:35 a.m.Francisco Rodriguez
Jul 24 '14, 12:08 p.m.sam detweiler
Jul 24 '14, 12:30 p.m.