- They must be in the same project as their parent
- They must have the same permissions (issue-level security) as their parent
- They must be of an issue type that is flagged as a "subtask" type, so for example, a "Feature" cannot be a subtask of a "Story" unless you create a separate "Feature (subtask)" issues type.
The Greenhopper UI operates mostly via a REST API, and so far this API is not well documented. Last night I got around this lack of documentation by using mitmproxy to monitor calls while moving issues up and down the planning page in Greenhopper's Rapid Board. Then I added a simple rest client class to jiranemo based on restkit. I made two helper functions: one to get the rest representation of an issue, and another to change the rank of an issue in Greenhopper. My script looks like this:
#!/usr/bin/python import sys import pyjira from jiranemo import jiracfg # Set the exception hook to enter a debugger on # uncaught exceptions from jiranemo.lib import util sys.excepthook = util.genExcepthook(debug=True, debugCtrlC=True) # Read ${HOME}/.jirarc, and set up clients and auth caches. cfg = jiracfg.JiraConfiguration(readConfigFiles=True) authorizer = pyjira.auth.CachingInteractiveAuthorizer(cfg.authCache) ccAuthorizer = pyjira.auth.CookieCachingInteractiveAuthorizer(cfg.cookieCache) client = pyjira.JiraClient(cfg.wsdl, (cfg.user, cfg.password), authorizer=authorizer, webAuthorizer=ccAuthorizer) # Do a simple JQL query via the SOAP client, return 20 results issues = client.client.getIssuesFromJqlSearch( '''project = "system testing 2" order by Rank DESC''', 20) for x in issues: # Get the REST representation of each issue, because links # aren't shown in the SOAP representation rest_issue = client.restclient.get_issue(x.key) for link in rest_issue['fields']['issuelinks']: if link['type'].has_key('inward') and \ link['type']['inward'] == "is blocked by": # Rank the linked issue above this one in Greenhopper result = client.restclient.gh_rank(link['inwardIssue']['key'], before=rest_issue['key'])The code could use some error checking, but this is a pretty simple starting point for doing something that Jira and Greenhopper can't do on their own.