It's not the same without you
Join the community to find out what other Atlassian users are discussing, debating and creating.
I'm intend to update the component lead during runtime. I'd created a post function script to perform the following:
import com.atlassian.jira.bc.project.component.ProjectComponent;
import com.atlassian.jira.bc.project.component.MutableProjectComponent;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.bc.project.component.ProjectComponentManager
long pid = ComponentAccessor.getProjectManager().getProjectObjByKey("XXXX").getId();
ProjectComponentManager projectComponentManager = ComponentAccessor.getProjectComponentManager();
ProjectComponent existingComponent = projectComponentManager.findByComponentName(pid, "YYYY");
MutableProjectComponent newComponent = MutableProjectComponent.copy(existingComponent);
newComponent.setName("NAME");
newComponent.setDescription("DESC");
newComponent.setLead("PERSON");
projectComponentManager.update(newComponent);
Observed that the user name did not populate and update correctly (shown as '?' on the Project -> Component Screen).
Same script had been trigger on the Script Console and it works just fine.
Any idea what was the problem?
Hi Jamie,
Thanks for the response. I'd tested a few rounds and noticed that by setting the Lead Name to a user id from our Active Directory, it ended the results as "User does not exist".
but if i set it to a JIRA user from JIRA internal directory, it seems being set correctly.
Any idea what could went wrong?
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.
Read moreHey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...
Connect with like-minded Atlassian users at free events near you!
Find a groupConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.
Start an AUGYou're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.