transition-jira-issue
Move a Jira issue to a new status by providing the issue key and transition ID.
Instructions
Transition a Jira issue to a new status
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issue_key | Yes | ||
| transition_id | Yes |
Implementation Reference
- Registration and schema definition for the transition-jira-issue tool, listing issue_key and transition_id as required parameters.
types.Tool( name="transition-jira-issue", description="Transition a Jira issue to a new status", inputSchema={ "type": "object", "properties": { "issue_key": {"type": "string"}, "transition_id": {"type": "string"}, }, "required": ["issue_key", "transition_id"], }, - Handler for transition-jira-issue tool execution. Validates arguments, calls jira_client.transition_issue(), then fetches the issue to display the new status.
elif name == "transition-jira-issue": issue_key = arguments.get("issue_key") transition_id = arguments.get("transition_id") if not issue_key or not transition_id: raise ValueError("Missing required arguments: issue_key and transition_id") await jira_client.transition_issue( issue_key=issue_key, transition_id=transition_id ) # Get the issue to see the new status issue = await jira_client.get_issue(issue_key) new_status = issue["fields"]["status"]["name"] if "status" in issue["fields"] else "Unknown" return [ types.TextContent( type="text", text=f"Transitioned Jira issue {issue_key} to status: {new_status}", ), types.EmbeddedResource( type="resource", resource=types.TextResourceContents( uri=AnyUrl(build_jira_uri(issue_key)), text=f"Transitioned Jira issue {issue_key} to status: {new_status}", mimeType="text/markdown" ) ) ] - JiraClient helper method that sends a POST request to the Jira API to transition an issue to a new status using the transition ID.
async def transition_issue(self, issue_key: str, transition_id: str) -> Dict[str, Any]: """Transition an issue to a new status.""" data = { "transition": {"id": transition_id} } return await self.post(f"issue/{issue_key}/transitions", data) - JiraClient helper method to retrieve available transitions for an issue, which can be used to discover valid transition IDs.
async def get_transitions(self, issue_key: str) -> Dict[str, Any]: """Get available transitions for an issue.""" return await self.get(f"issue/{issue_key}/transitions") - Data model representing a Jira transition with id, name, and to_status fields.
class JiraTransition: """Representation of a Jira transition.""" id: str name: str to_status: str