In a good part of our projects, the allocation of Issues happens through components, but also the allocation of subtasks. The components used to assign a Issue to someone in the Subtask should be hidden when creating a Issue.
only some selected components need to be hidden. hidden components have the same name across all projects and projects use the same workflow.
We have automation, JMWE of tools for something like that. Can someone help me?
Best regards
Jurica
Hi @Jurica Petricevic ,
components are related to the project and not the issue type(s), so you're not going to be able to 'hide' certain components for certain issue types.
If you want to restrict a field to your sub-tasks, you should consider switching to a dedicated custom field and restrict its usage/availability to your sub-tasks. While the assignment might get a bit more complex (no more assign to component lead' but 'if option A then assigned B, if option C then assignee C, etc.) I don't see another option here.
Cheers
Thorsten
This is the more difficult solution than the one we currently have. For now, the project has already come to life like this. I hope to find some solution how to hide the peeled components in the jira.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm assuming that you are using the Component's Default Assignee. Unfortunately, it's not possible to exclude Subtask from the Component's Default Assignee.
However, since you have automation, maybe you can consider implementing the default assignee based on Component via automation(not sure which Jira apps you are using) or JMWE(Workflow post-function - Set field value).
I hope that this helps.
Thanks,
Moga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
there are 3 components in each project that serve as a type of Issue assignment but also a viewer of done subtasks. It was one big problem and it should stay that way but it should also be hidden when creating the main ticket. I use these components in Automation rules and no one else should see them. but I cannot hide them in Jira.
Thanks for your help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm quite confused here, if you want to hide the Component field, then no users can fill in the field value and the Automation rules are not going to be triggered.
Would you be able to elaborate more on this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
these components are used only by automation. No user needs to do anything with them and they don't need to be seen. I use automation in such a way that when the main ticket changes the status, I create subtasks which then get this component and then belong to a certain assignee.
I just don't want those 3-6 components to be seen when creating the main ticket.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay, from what I can understand so far is that, you do not want anyone to fill in the Components field for the Subtask issue type except via Automation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I need that field. I need a component field because the Users needs / should choose one from the list where there are 4-5 of them that are suggested to him, but there are also notneeded once on that list, they shuldnt be shown, 3-6 Components i mentioned earlier.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm sorry, I'm having trouble understanding your requirement. What you are looking for is; during the issue creation/edit, you would like to show a subset of the Components list?
If yes, then you will need a Jira app like Scriptrunner - the script would be something similar to Restricting Priority And Resolution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's exactly it. I need only the desired components to be displayed when creating a ticket, just like on this link. We also have Scriptrunner available for use in our company.
is there a chance we can try to make code together?
I think a good option would be to make sure that components called SSK and ORG are not shown. In all projects, the unwanted Components are called the same.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okie dokie, I will come up with a working code tomorrow. It's night time here. :D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
do we have any progress here?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Apologies for the late reply. I totally forgot about this. There you go:
import com.atlassian.jira.component.ComponentAccessor
import static com.atlassian.jira.issue.IssueFieldConstants.COMPONENTS
def projectComponentManager = ComponentAccessor.getProjectComponentManager()
def components = projectComponentManager.findAllForProject(issueContext.projectObject.id)
getFieldById(COMPONENTS).setFieldOptions(components.findAll { it.name in ["Component 1", "Component 2"] })
You can change options in ["Component 1", "Component 2"] to your preference.
Do let me know if there is anything else I could you with.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
this is totally the opposite but still useful.
I need not show 3 components that are common in all projects and here I can hide individual ones.
Whether there is a way to change this script so does she not show the component ssk 1, ssk 2, ssk 3. All projects share these three components but each of the 150 projects has its own specific components that I do not want to enter manually here because in some there are also 150 of them.
Best regards
Jurica
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.