I am trying to create a Macro to prompt user for a Jira#, and then pull in specific custom fields to display in confluence. I found this
Example: Get Jira Issue Information on a Confluence Page
I successfully created the Macro based off your example, I am not able to figure out how to get one of our Custom Jira fields added, I get 'null' results back every time. Are there any examples of how to pull in a custom jira field?
Hi Tracy,
I can confirm in the example above the issue variable returns all fields on an issue so you can access custom fields using the customfieldId e.g like
${issue.fields.customfield_10010}
where customfield_10010 is the ID of the custom field you wish to return the value back from on the issue.
I have tested this using the text variable like below to show the value of a custom single select list field and a custom single line text field and can confirm this works as shown in the screenshot below.
Please note you will need to change the properties you access on different field types based on the field type and the best way I can advise to see what properties exist on a field is to run the Get Issue Fields example script on the Script Console page in Jira to see how data is stored on fields for an issue.
I hope this information helps.
Regards,
Kristian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tracy,
You are welcome.
If this answer solved your issue, could you please mark it as accepted to show it has correct for other users searching for the same question.
Regards,
Kristian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Tracy Langston x2472
What is the custom field type of the field you are trying to access?
Show us each of the methods you have tried to include the field in the output.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I got most of what I needed from Kristian's examples above, but still needing to know how to pull in custom field that is a 'User Picker' field. Could you help me with that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried the method recommended by Kristian to get the data?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Disregard that last question Trudy. I found it :-)
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.