Import different number of custom fields for the different issue types?

Hello,

I am looking for a way to create different number of custom fields for the different issue types. For example: can I import 4 custom fields for Bugs and 10 for Tasks?

If this is not possible, can I execute the query from IssueTransformer with all of the fields and then remove some of them?

Petya

2 answers

1 accepted

Nothing stops you from that. For the engine it all matters what's inside ExternalIssue.

So your IssueTransformer may put 4 custom fields for a bug and 10 for an improvement. As long as you know in the IssueTransformer what issue type your dealing with currently.

I'm not sure - are you just asking theoretically or is there any actual problem with this?

In my case, for each issue type in a project I have different number of custom fields. The query in the IssueTransformer is called only once, so I have to put all of the custom fields there. But then I don't want to have unused field in JIRA and I want to remove these which are not part of the particular issue type. For instance: for Task the project usually has field Efficiency while Bug doesn't use it. I tried a few things, but it didn't work.

Sure, you pull all of them, but then based on the configBean you decide which actually to put into ExternalIssue. At the time IssueTransformer is executed you should have everything (the configuration) in your configBean so you need to make IssueTransformer smarter.

Also you can have your IssueTransformer doing a simple query by default and then for each issue type doing subsequent selects to get the details. As you'll notice we do like that in many places.

It was very simple solution... I just override the method SetCustomFiledsValues in my IssuesTransformer. There I put a filter over the issue types and everything started working as I wanted it!

Thanks!

In my case, for each issue type in a project I have different number of custom fields. The query in the IssueTransformer is called only once, so I have to put all of the custom fields there. But then I don't want to have unused field in JIRA and I want to remove these which are not part of the particular issue type. I tried a few things, but it didn't work.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Posted 12 hours ago in Jira

We want to know what Jira Service Desk apps you're using!

Hi Community! My name is Amir and I’m on the Jira Service Desk product marketing team at Atlassian. Our team would love to understand how you’re leveraging our ecosystem for Jira Service Desk. Wha...

35 views 0 5
Join discussion

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