<p>Is there a way to modify what branch a service hook is monitoring through a Jenkins job?  </p>

<p>Our build jobs within Jenkins are triggered via service hooks within TFS.  When we branch, inevitably we forgot to go over to TFS and update the service hook branch. Our thought was to have a Jenkins job, create the new branch and then perform some magic to update the service hook subscription with the new branch.  </p>

<p>So far our research has come up with nothing. </p>

CC BY-SA 4.0
2019-09-27T03:58:43.777Z
Have you investigated tne [TFS REST APIs](https://docs.microsoft.com/en-us/azure/devops/integrate/previous-apis/overview?view=azure-devops-2019#full-list-of-rest-apis)? You could write a job that uses tje Git API to branch, then the Service hooks API to create or update the service hook.
Ian W
CC BY-SA 4.0
2019-12-25T10:14:04.037Z
Could you reply to the comment?
030
<jenkins><automation><tfs>
Update Service Hooks in TFS2015 through Jenkins Job
treeNinja
# Update Service Hooks in TFS2015 through Jenkins Job

(Asked by: username_0 on 2019-06-06)

Is there a way to modify what branch a service hook is monitoring through a Jenkins job?

Our build jobs within Jenkins are triggered via service hooks within TFS. When we branch, inevitably we forgot to go over to TFS and update the service hook branch. Our thought was to have a Jenkins job, create the new branch and then perform some magic to update the service hook subscription with the new branch.

So far our research has come up with nothing.

**Tags:** jenkins, automation, tfs

> **Comments:**
> **username_1**: Have you investigated tne [TFS REST APIs](https://docs.microsoft.com/en-us/azure/devops/integrate/previous-apis/overview?view=azure-devops-2019#full-list-of-rest-apis)? You could write a job that uses tje Git API to branch, then the Service hooks API to create or update the service hook.  
> **username_2**: Could you reply to the comment?  

---

## 0 answers

