Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Can we make a copy of FixVersion field as a custom field?

Kent Chiu
July 13, 2017

We would like to have a custom field like FixVersion where it can automatically get the list of values from the releases. It is requested by our program manager to track what are the tickets that are being proposed for a particular releases.

Is ther anyway we can copy the FixVersion field as a custom field?

E.g. Propose release custom field that are behaves just like FixVersion?

Another way to do it is to create a custom field with list of values that we have to provide list of releases as selection list. But this is not efficient and can be out of control due to increasing releases.

Thanks for your help.

Regards,

Kent 

6 answers

1 accepted

0 votes
Answer accepted
Manuel Campomanes
Contributor
February 9, 2012

there was a problem with the import.

Solution >

from com.atlassian.jira import ComponentManager

Manuel Campomanes
Contributor
February 9, 2012
Here is the solution to set a customfield type Date in a post-function (python) :

from com.atlassian.jira import ComponentManager import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.fields.CustomField import datetime customFieldManager = ComponentManager.getInstance().getCustomFieldManager() customField = customFieldManager.getCustomFieldObject("customfield_10008") issue.setCustomFieldValue(customField, datetime.datetime(2012, 5, 29, 10, 30, 45))

Check datetime documentation for more options.

1 vote
Stein Jakob Modalsli
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 24, 2012

A little late answer, but in case someone else has the same problem:

I also had this problem when trying to edit an old plugin.

The reason for this is that, by default, "jira-core" has been excluded as an dependency in pom.xml.
Remove the <!-- and --> in the code below to include "jira-core".
This solved my problems.

<!-- Add dependency on jira-core if you want access to JIRA implementation classes as well as the sanctioned API. -->
<!-- This is not normally recommended, but may be required eg when migrating a plugin originally developed against JIRA 4.x -->
<!--
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-core</artifactId>
<version>${jira.version}</version>
<scope>provided</scope>
</dependency>
-->

0 votes
jeyaluxshan
October 25, 2018

I am new to python scripting. When i run, i am getting following import error.

ImportError: No module named com.atlassian.jira.component

How can i fix this? where can i download com.atlassian.jira.component module and install.

Any suggestions much appreciated.

Regards

Jey

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
February 9, 2012

> there was a problem with the import

that's why i thought it didn't look like python.

0 votes
Manuel Campomanes
Contributor
February 9, 2012

I take a look about this : https://studio.plugins.atlassian.com/wiki/display/JSS/Scripting+Samples

It's a copy modified.

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
February 9, 2012

Did you write that yourself, or copy it from somewhere? That doesn't even look like jython code.

Suggest an answer

Log in or Sign up to answer