I would like to display the Team capacity value defined in Jira Plans on a Confluence page that lists out all teams within our portfolio.
Is there a way to display perhaps via smart values? I have reviewed the documentation and don't see anything that would point me in the right direction.
Thanks in advance!
Hi @Maria Del Rosario Gonzalez
Displaying the team capacity value defined in Jira Plans on a Confluence page is a bit tricky because there isn't a direct out-of-the-box integration for this specific requirement using smart values. However, you can achieve this through a combination of Jira and Confluence functionalities along with some custom scripting. Here's a step-by-step guide to get you started:
You will need to fetch the team capacity data from Jira using the Jira REST API. You can write a script (in Python, for example) to fetch this data.
Next, you can use the Confluence REST API to create or update a Confluence page with the fetched team capacity data.
To automate this process, you can set up a script to run at regular intervals, fetch the latest team capacity data from Jira, and update the Confluence page.
Here's a simplified example of how you might write a Python script to achieve this:
import requests
import json
# Define your Jira and Confluence credentials and URLs
JIRA_URL = 'https://your-jira-instance.atlassian.net'
CONFLUENCE_URL = 'https://your-confluence-instance.atlassian.net'
JIRA_API_ENDPOINT = '/rest/api/3/path-to-team-capacity-endpoint'
CONFLUENCE_API_ENDPOINT = '/wiki/rest/api/content/'
JIRA_USERNAME = 'your-jira-username'
JIRA_API_TOKEN = 'your-jira-api-token'
CONFLUENCE_USERNAME = 'your-confluence-username'
CONFLUENCE_API_TOKEN = 'your-confluence-api-token'
def get_team_capacity():
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.get(f"{JIRA_URL}{JIRA_API_ENDPOINT}", auth=(JIRA_USERNAME, JIRA_API_TOKEN), headers=headers)
return response.json()
def update_confluence_page(content):
headers = {
'Authorization': f'Basic {CONFLUENCE_API_TOKEN}',
'Content-Type': 'application/json'
}
data = {
'type': 'page',
'title': 'Team Capacity',
'space': {'key': 'YOUR_SPACE_KEY'},
'body': {
'storage': {
'value': content,
'representation': 'storage'
}
}
}
response = requests.post(f"{CONFLUENCE_URL}{CONFLUENCE_API_ENDPOINT}", auth=(CONFLUENCE_USERNAME, CONFLUENCE_API_TOKEN), headers=headers, data=json.dumps(data))
return response.json()
def format_content(data):
content = "<h2>Team Capacity</h2><table><tr><th>Team</th><th>Capacity</th></tr>"
for team in data['teams']:
content += f"<tr><td>{team['name']}</td><td>{team['capacity']}</td></tr>"
content += "</table>"
return content
if __name__ == "__main__":
team_capacity_data = get_team_capacity()
formatted_content = format_content(team_capacity_data)
update_confluence_page(formatted_content)
If you're looking for an easier way, try Planyway addon for Jira.
The Planyway app for Jira can be a helpful tool for visualizing and managing your team’s capacity and workload. It provides a user-friendly interface for planning and tracking projects, making it easier to manage resources and timelines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.