Hello,
I installed "Quisapps Jira Scripting Suite" plugin on my Jira, I need to execute jython script on workflow transition so I use Jython post-function script.
I try to edit a customfield so I do that :
import com.atlassian.jira.ComponentManager import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.fields.CustomField customFieldManager = ComponentManager.getInstance().getCustomFieldManager() customField = customFieldManager.getCustomFieldObject("customfield_10008") issue.setCustomFieldValue(customField, "15/02/2012 10:02")
But I have an error cause by the ComponentManager, he's not defined (name 'ComponentManager' is not defined)
I search information about this error but I failed. I hope you can help me.
Cheers,
Manuel.
there was a problem with the import.
Solution >
from com.atlassian.jira import ComponentManager
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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>
-->
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> there was a problem with the import
that's why i thought it didn't look like python.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I take a look about this : https://studio.plugins.atlassian.com/wiki/display/JSS/Scripting+Samples
It's a copy modified.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you write that yourself, or copy it from somewhere? That doesn't even look like jython code.
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.