Good day everyone.
I host my own JIRA and Confluence Server and I have setup the application links from both sides. I would like to make the reporting easier and automate the process and I know I have to write some scripts using ScriptRunner plugin to do this. I have done my research and wrote some scripts but unfortunately I fail to get this to work. I hope to get some ideas from the users here.
Use case/requirement:
1. (Done) Once I create a new project in JIRA, a confluence space for the new project will automatically be created by calling Confluence API.
2. The space is created using my default customized blueprint space template. The template has some Chart Macro. When I create the project in JIRA, I want to pass the project Key to the JQL query in the Chart Macro so the chart will automatically reference the project I just created instead of me having to go to Confluence and edit the Chart Macro.
3. When I update JIRA issues, (E.g I log 1 day of work in the work hours of an issue ), it will automatically update the confluence space as well. My idea for this is that I have a Total work hours variable in Confluence and it will be updated whenever someone logs work. I can use this to see if the project is behind schedule by calculating the total work hours logged against the estimated project duration.
Problems faced when writing scripts using ScriptRunner:
1. If I have a Chart Macro in a Confluence space/page, how to update the JQL query of the the particular macro by calling Confluence API? (e.g update the PROJECT = "newProject")
2. How do I get the fields value in JIRA? (e.g get the value of logged hours for each issue) I believe I may need to use something called IssueManager?
3. How do I specify the object to be updated in Confluence? Is there any unique ID or something for each object and where can I find these ID? I looked around but it doesn't seem like Confluence has some sort of dynamically-changable variable. I thought it would be like coding where I can put an object or a variable in the confluence page and then I can make a POST request from JIRA to update the Confluence object by passing the latest object value to the Confluence API with unique object ID. (e.g there is a variable/obejct that display total work hours in Confluence page and this will be updated whenever I log work hours in JIRA)
I am sorry for the long post. I am not sure where should I ask these questions and so I thought the community would have some ideas. You may remove this question if this is out of topic/not appropriate here. Feel free to ask for clarification if my questions are unclear. Thank you guys and your feedback in advance!
As a follow up, I can already achieved requirement 1 and 2 by writing my own scripts.
However, I still can't get my head around requirement 3. I am not sure how to display the logged work hours. I'm not gonna use pie chart to show progress lol. Do I have to write my own custom chart for this? :( Is there any way or plugin or macros that is suitable to show project progress in terms of time/logger work hours?
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.