Confluence/Jira communication from F# and C#

jira_confluenceNowadays, Atlassian products become more and more popular. Different companies and teams start using Jira and Confluence for project management. It would be good to have an ability to communicate with these services from .NET. As you probably know, Jira and Confluence are pure Java applications. Both applications provide SOAP and REST services. REST is a new target for Atlassian, they focused on it and do not touch SOAP anymore. So SOAP services live with all their bugs inside and even deprecated in JIRA 6.0.

It is a bit strange for me. I can understand REST benefits, but it is step backward for developers’ convenience. Each programming language should maintain a client library. Any change in REST API can break all client tools. REST produces a lot of headache for service users. IMHO, REST should be done in OData manner to simplify life for API users. But it is out of topic a bit.

I have tried to use Jira and Confluence web services some time ago, it was harder and more limited then existing SOAP ones. I have not checked the latest ones, you can try if you wish: Confluence REST API documentation and JIRA REST API Tutorials. As I know, there is no mature client libraries for .NET.

I have already tried to get to work F# WSDL Type Provider and Confluence SOAP service. But it does not work, because a Confluence SOAP endpoint is not compatible with WCF. There is a known bug “Creating Service Reference from JIRA WSDL in Visual Studio 2010 generates all methods void“, that would not be fixed.

Workaround for C# guys

The workaround is to create a Web Reference vs Service Reference. Details you can find on StackOverflow: “Web Reference vs. Service Reference“. But I want to repeat these steps here:

  1. Click on ‘Add Service Reference’.atlassian_1
  2. Click on ‘Advanced’ button.altassian_2
  3. Click on ‘Add Web Reference’ button.altassian_3
  4. Paste an URL to the WSDL of Confluence SOAP service and click on the ‘Go to …’. (
  5. Click on ‘Add reference’ button.
  6. Repeat same steps for Jira SOAP service. (
  7. That is all you need to start working with Jira and Confluence. As a result, you should see two web references in your project.atlassian_7

Workaround for F# guys

The easiest way to do it from F# is to build proxy library in C# and reference it from F#. I have already done it and if you wish you can download it from GitHub. There is one issue in such solution – function’s parameters named in not readable way like arg0, arg1 and so on. To understand what actually you should pass to the service you need to check actual parameter names in documentation: JiraSoapService and ConfluenceSoapService.

Confluence sample script:

#r @"..\Altassian.Proxy\bin\Release\Altassian.Proxy.dll"

let service = new ConfluenceSoapServiceService(Url = @"https://SERVER_NAME/rpc/soap-axis/confluenceservice-v2?WSDL")
let token = service.login("LOGIN","PASSWORD")

|> Seq.iter (fun x-> printfn "%s" )


Jira sample script:

#r @"..\Altassian.Proxy\bin\Release\Altassian.Proxy.dll"

let service = new JiraSoapServiceService(Url = @"https://SERVER_NAME/rpc/soap/jirasoapservice-v2?wsdl")
let token = service.login("LOGIN","PASSWORD")

service.getIssuesFromJqlSearch(token, "status = open", 10)
|> Seq.iter (fun x-> printfn "%s" x.summary )


All source code is available on GitHub.

3 thoughts on “Confluence/Jira communication from F# and C#

  1. Pingback: Confluence: MyPGS
  2. Pingback: Confluence: MyPGS

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s