I am using a JIRA macro on an on-prem Confluence 6.14.2 page.
In the macro, as part of the JIRA issue filter, I want to use the currently logged-on Confluence user as a variable in the JIRA assignee field. Then, I'll restrict editing of the page so that users cannot see any issues that are assigned to others. Users can only see their own issues, at least in Confluence. (!Important)
What is the easiest way to get the current Confluence user name to appear in the filter field of the JIRA macro? (The Confluence platform admin has locked down creation of User Macros, so my solution will have to probably use only on-page javascript, or similar.)
Here is my xhtml:
<p>
<ac:structured-macro ac:macro-id="39265a4e-f7e7-4c75-b8c2-c956cde9922c" ac:name="jira" ac:schema-version="1">
<ac:parameter ac:name="server">ServerName</ac:parameter>
<ac:parameter ac:name="columns">key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution</ac:parameter>
<ac:parameter ac:name="maximumIssues">20</ac:parameter>
<ac:parameter ac:name="jqlQuery">project = PROJECT AND status != Done AND assignee = [current Confluence user] </ac:parameter>
<ac:parameter ac:name="serverId">3094394f-4ff6-3c13-8625-7c1a63b63bf9</ac:parameter>
</ac:structured-macro>
</p>
Thanks, --K
You should be able to use the currentUser() function in the JQL query:
So you would use this for the JQL:
project = "PROJECT" AND status != "Done" AND assignee = currentUser()
This should search based on the current logged in user from the context of Confluence.
That is the exact variable that I was trying, and for some reason it stopped working this week. I had it working last week, but this week instead of using the currentUser() variable string, the JIRA macro resolved the variable string to my logon id string -- essentially hard-typing it into place for all users of the page.
Now today, inexplicably, it is indeed working again. What is going on with the currentUser() variable that sometimes works and sometimes does not?!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Still no word on why the currentUser() variable sometimes works and sometimes doesn't in the Edit mode of a Confluence page. Thanks, --K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.