Hi,
I need to get the repository a task was created in from a TaskCreatedEvent
. Most of the events in Stash provide a getRepository
method, but this event does not. Is there any way to retrieve the repository the task was created in via Stash's API?
I'm able to retrieve the comment itself the task was created from by Task#getAnchor
, but that does not help much either...
Any help is much appreciated.
Thanks,
Michael
Community moderators have prevented the ability to post new answers.
@Angela Beteta No, unfortunately not. This also hasn't changed with the revised Bitbucket server Java API...
@Michael Tarragona, Have you got the solution to this? I also need to find an easy way of getting the pull request information from a task.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nope, unfortunately not: @EventListener public void onTaskCreated(TaskCreatedEvent event) { //event.getSource() yields TaskService }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you have some kind of context object somewhere? There has to be something else than this TaskCreatedEvent object.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes it is, but unfortunately, the Stash API does not allow to retrieve the pull request from the task. With only the task ID at hand, I don't know how to efficiently (without going through all the pull requests of all repositories) get the pull request object from it. Any ideas?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is this the event that comes when someone creates a task in a pull request? If it is, in that context you should be able to get to the repository from the pull request object.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.