Close JIRA Issues when Fixing Jobs in Perforce

Still need help?

The Atlassian Community is here for you.

Ask the community


The JIRA Fisheye plugin can create a corresponding perforce job for each issue. However when submitting fixes in perforce, the JIRA issue is not automatically closed as well.


There is a feature request for this functionality to be included with the plugin:


The functionality is independent of the JIRA Fisheye plugin, and Perforce and JIRA already provide the requisite functionality to implement this.

Firstly you need to create a soap client that will call the JIRA remote API to close the issue. Here is a very rudimentary example in Python:

import SOAPpy, getpass, datetime, sys

soap = SOAPpy.WSDL.Proxy('')


auth = soap.login(jirauser, passwd)

for arg in sys.argv[1:len(sys.argv)]:

        issue = soap.getIssue(auth, arg)

        print 'Closing issue..', issue['key']

        # the default "fixed" resolution has an id of 1
        # the default close workflow action has an id of 2
        soap.progressWorkflowAction(auth, issue['key'], '2' , [
                {"id": "resolution", "values": "1" }

print "Done!"

This will be invoked as <List of JIRA Issue Keys>.

Next we create a perforce fix trigger using p4 triggers. The trigger should look something like this:

        closeJira fix-add fix "/Users/amyers/ %jobs%"

Note that the assumption here is that all the jobs have an ID that corresponds to a JIRA issue key.


  • The script should be modified to check for valid issue keys and handle perforce jobs that do not have a corresponding JIRA issue.
  • The script hardcodes resolutions/workflow action ids so it will not work with a custom resolution/workflow
  • This is not supported by Atlassian and is only provided as an example.

Last modified on Jul 31, 2018

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.