how to auto create issue & follow-up id in jira based on customs field option and issue move to one tranistion to another tranisiton.

subhaa June 1, 2016
 

2 answers

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 2, 2016

I'm confused by some of the question, and would like some explanation on other bits:

>auto create issue

Lots of ways, but the question here is when?  When do you want to automatically create an issue - what is the trigger?

>follow up ID

I don't know what you want from "and follow up id"

>based on custom field options

What do you want to do with the options in a custom field?

>issue move to one transition to another transition

I'm afraid that is nonsense.  Issues move from one status to another through transitions.  Talking about transitions in that way simply doesn't make sense and I can't guess at any meaning.

Sorry that's a bit of a brain dump, but I'm really struggling to understand the question.

subhaa June 2, 2016

Hi,

really we need to auto create issue in JIRA based on the custom field values.

we have one custom field called as "Manual Hotfix required?" if values is yes means create one issue in another project. if it is no means no action required.

how we can do this?.

if this action was happen in workflow transition.

For example : issue status changed to pending to fix reviewed. At this time we need to check that custom field values (Manual Hotfix required?='Yes' ) is trun means auto create one issue in another project. 

 

 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 2, 2016

Ok, that's explained it all.

You'll need to write a little bit of code to do this - you need a post-function that can read the current value and construct a new issue in the other project.

I'd use the script-runner add-on as usual.

subhaa June 2, 2016

Hi ,

we have downloaded some add ons and tried to create a issue while changing the transition from one to other and also check the custom field value . it results some error.

error.png

 

 

i am using the post functions and add ons as below :

 

workflow enhancer fore JIRA 

 

 

 

 

 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 2, 2016

How did you install the add-on?  Via the UPM (Admin -> Add-ons -> Find new add-ons) or manually via "uppload add-on"?

rTrack Support June 2, 2016

Hi Nic,

We've installed the add on by using -> find new add on's

and installed it on usual basis. We didn't upload the add on.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 3, 2016

Ok, that's good, because it means you have installed a valid version of the add-on (There's been a trend recently here on Answers for reports of add-ons not working, which, when investigated, it's because some idiot has installed a version that's invalid)

On the down-side, that actually suggests that there's either a bug in the add-on, or an oversight in the code that lets you do some bad configuration and the add-on doesn't handle it well.

The question now is what exactly have you configured there?

rTrack Support June 3, 2016

HI Nic,

we have tried to create a new issue using the post function when a custom field value satisfies the condition then issue will be create or else no need to create.

postfunction.png

this is the post function screen .

first we are checking the field with boolean function and the using issue clone post function .u can see that in the image .

 

we have tried with the different type of conditions to evaluate. but it results with error or else issue not creating.

 

 

conditions used :

{Manual HotFix required?} == "Yes"

{Manual HotFix required?} == "[Yes]"

{Manual HotFix required?} == ["Yes"]

{12060} == "Yes"

{12060} == "[Yes]"

{12060} == ["Yes"]

 

 

please provide any suggestion for the sample condition .

 

 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 3, 2016

Ok, got it - you're using a boolean field and a string as the input.  Boolean fields can only have three values null/empty, true and false.  Comparing them to strings like "yes" won't work.

rTrack Support June 3, 2016

we have checked with true and false value also .but no luck on this .

can you pls suggest or provide any sample format for the condition .

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 3, 2016

What, exactly is the field you're checking?  The type and values you're looking for?

rTrack Support June 3, 2016

Manual hot fix required is the combo field .it have two values yes or no .but after ur suggestion we have changed as true and false.

 

if the manual hot fix required combo is selected with the value true  during the transition then need to clone the issue through the post function and changing the status as per the transitions .this is wat we are exactly looking .

0 votes
Vasiliy Zverev
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 Leaders.
June 5, 2016

It seems that you need some more hardcode-solution. U would recommend you to create a you on script function. 

At first see this (https://answers.atlassian.com/questions/32982259) for fast develop of postfunction. I ussually use same scripted field to test my postfunction. 

Let start with first part - how to evaluate is it reqared to create an issue. I assume that you use a radio button custom field. Here is code example which returns true when hotfix requred, and false when not requared or fild is empty:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.fields.CustomField

CustomField radioButton = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Manual HotFix required?");

if(radioButton == null)
    return "no such field"

if(radioButton.getValue(issue) == null)
    return "false"

if(radioButton.getValue(issue).toString().equals("Yes"))
    return  "true"
else
    return "false"

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events