How to set component from current confluence page name in issue collector?

I have a Confluence space each of whose pages has a "component" of the same name in a corresponding JIRA project.

I have deployed an issue collector in the footer of the space so it appears on every page of the space.

I would like to set the component of an issue created using this issue collection to be the name of the current page.

Is there a way to perform this?

 

1 answer

1 accepted

0 vote

I don't think this is currently possible to do.  I will try to explain why that is here. 

So our documentation on the Advance use of the Jira issue collector does explain in some detail how you can set field values in the issue collector trigger itself.   It does not explicitly tell you how to set components though.    As other community users have discovered in threads such as:

https://community.atlassian.com/t5/Answers-Developer-Questions/Set-fieldValues-in-JIRA-Issue-Collectors/qaq-p/464201

and

https://community.atlassian.com/t5/Jira-questions/Pre-set-Component-for-Issue-Collectors/qaq-p/73825

Components cannot be set by their name when using an issue collector like this to specify values, such as 'componentA' or 'componentB'.  Instead, you have to set these based off their internal component ID number (these are usually 5 digit numbers that typically start at 10000 or 10100 and tend to be sequential in the order the component was created).

The hurdle that I can't seem to find a way to get over here is translating the component's name into the component's ID number from within Confluence.  If you could specify the component value by the actual name of the component, then perhaps there is some kind of javascript code that could be hacked out in order to pass that into the collector.  But since component requires an ID number, and Confluence does not really have a means to know or store that ID value, I can't seem to find a way to do this either.

If you knew the ID ahead of time, you could certainly configure the trigger code accordingly on each space, but I'm guessing this would be really tedious to do if you have a lot of components in Jira.   I suspect you are looking for a single bit of trigger code to place on each confluence page that is same so that you don't have to try to create/manage different code for different spaces.

Of course I welcome any other thoughts on how this might be accomplished.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Monday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

711 views 6 13
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you