post function for edit

is it possible to set validators and post functions for "edit"?

we're currently using minyaa for this, but we plan to go to jira 6 and want to disable the minyaa-plug-in.

3 answers

Edit is not a transition, but operation. So you can't assign validator/condition/post/functions to this. You can do something by configuring the Field Configuration Scheme (make fields mandatory), or registering listeners to the edit event ...

However I don-t know if this is still true for Jira 6.x

Can you explain what kind of validators or postfunctions want to setup?

HTH

I have a self-written plug-in which takes a field-value, checks if it's ok (it asks a webservice in the background) and then it throws a error message or it let pass.

as of now not possible to configure validator for edit operation but you can do this by JavaScript

try with this

<script type="text/javascript">
jQuery(document).ready( function($) {
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(e,context) {
    callValidateFunction();
});
callValidateFunction();
function callValidateFunction(){
    $('#edit-issue-submit, #issue-edit-submit').click(function() {
        var field=document.getElementById('customfield_13786');//chang customfield id
        if(field !=null && field.value == ''){
        alert("Please Enter Field Value..")://change lert message as per your requirement
        return false;
        }
     
    });
 
}
});
 
</script>

check this post
https://answers.atlassian.com/questions/189606/how-to-make-custom-field-require-on-edit-screen?page=1#comment-190232

well, we made very bad experience with inline-editing and javascript...

so we would have to rewrite our plug-in to javascript, and we would have to call the webservice via js....

not the best solution...

at the moment, we're thinking about removing the affected fields from the screen and make a transition to itself with the fields as pop-up. so we can use validators...

not the best solution, too... :D

as you said "we're thinking about removing the affected fields from the screen and make a transition to itself with the fields as pop-up. so we can use validators"

it is a good solution, i agree that!!

Hi Stefan,

Another possibility is modifying your workflow and permission schemes to NOT allow edit at all. And, only in certain status, create a self-transition called Edit (rstricted to role), using a screen containing all your "editable" fields.

This way, end-users only notice that the Edit button is in another position, and the edit in the issue screen doesn't work. The good news are that the Edit became a transition, so you can add all your validators ...

HTH

yeah, see my comment on the other answer ;-)

but you know, customers/users... "ugh, the button is not where i expected it!!" :D

Just noticed your comments. You posted them while I was editing mine XD

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,345 views 14 20
Join discussion

Atlassian User Groups

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!

Find my local user group

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

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot