Skip to content

Instantly share code, notes, and snippets.

@nialdarbey
Created April 6, 2012 14:58
Show Gist options
  • Save nialdarbey/2320586 to your computer and use it in GitHub Desktop.
Save nialdarbey/2320586 to your computer and use it in GitHub Desktop.
/**
* Creates a story on Pivotal TRacker
*
* {@sample.xml ../../../doc/PivotalTracker-connector.xml.sample
* pivotaltracker:create-story}
*
* @param storyXml
* details of story
* @return Story xml
*/
@Processor
public String createStory(String storyXml) {
logger.info("Creating story ");
Client client = Client.create();
WebResource webResource = client.resource(storiesUrl);
storyXml = webResource.type(MediaType.APPLICATION_XML).header("X-TrackerToken", trackerToken).header("Content-type", "application/xml").post(String.class, storyXml);
return storyXml;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment