HOw to get project name under "title" field and its summary under content field of a page while creation of automatic page using script post function under a create issue.
issue is correct if you are running it from a post-function. If you are running it from the admin panel for testing you will need to get an issue yourself, eg:
def componentManager = ComponentManager.getInstance()
def issue = componentManager.getIssueManager().getIssueObject("JRA-1306")
Basically I have added custom field as "project name" under the create issue.
so I just want to fetch the value inside that customfield and place it as the title of mypage.
if u can tell me how to getvalue of that custom field i think the work would be done for me.
Why didn't you say project name was a custom field?
ComponentManager componentManager = ComponentManager.getInstance()
CustomFieldManager customFieldManager = componentManager.getCustomFieldManager()
def cf = customFieldManager.getCustomFieldObjectByName("Project Name")
issue.getCustomFieldValue(cf) // project name
Actually I was first trying out with the project name of every project name I create in jira but that was not serving my purpose as I wanted to have different pages for every different issue under the same project. So I made a customfield to capture the unique project name for each issue.
Thanks for the answer as it is exactly what I wanted to get.
perhaps my need is similar to this:
I have a custom field which options are the current project names of the Jira instance. But the project leads often change the name of the projects so - there about 200 projects we handle - it is cumbersome to update the options regularly.
Can you please send me a groovy script which result the list of the current project names (not keys!)? I have Behaviour plugin, so I thought I will add this script to this custom field in behaviour.
With Scripted field it would be the most simplest of course but we have an older version of Script Runner because our version 4.3 Jira.
Can you please suggest?
Thanks in advance!
Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...
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!
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