how can I give user a message in a postfunction ?

Vio ao December 1, 2013

I want to show a auimeaage to the user after a postfunction.How can I do that?

2 answers

1 accepted

2 votes
Answer accepted
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.
December 1, 2013

No. Post-functions are NOT for "judgement", they are for doing things when you have a definite set of validated data.

You should establish if your data CAN be processed in a validator and put the message in there. Or, you need to write some sort of message back into the issue so that when the user lands on the issue view screen, they get told the result

Vio ao December 1, 2013

but I need do somthing when click “close” or“reopen” in a postfunction。 And then
return a message to the user according the result of the doing things.

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.
December 1, 2013

As Bob says, you don't do this in a post-function.

If you click "close", you do one thing to the issue. If you click "reopen", you are doing something else. They go through different routes in the workflow, and that means you can put different post-functions on them to do different things. The decision about where a transition lands is made well before you reach a post function, that's too late for user interaction.

If your post-functions need to capture data and report back to the user, that's fine - they should write their information on to the issue so that results are logged.

Bob Swift OSS (Bob Swift Atlassian Apps)
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.
December 1, 2013

Listen to what Nic is saying. Post functions can't provide feedback. The transition has already been done, there are no further feedback opportunities. Only validators can give feedback prior to the transition.

Bob Swift OSS (Bob Swift Atlassian Apps)
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.
December 1, 2013

Here is a reference: Advanced Workflow Configuration

Vio ao December 1, 2013

how to do that in a Validator?

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.
December 1, 2013

A validator is a block of code that returns either "True" (meaning the transition is clear to continue) or "False" (user is returned to the transition screen or even the issue if there's no screen, without any changes being made).

With a "false" response, you add responses to the user by throwing InvalidInputException. If you want these to appear differently from the way Jira currently shows them, you'll need to amend the core code to provide alternate feedback.

Also, bear in mind the blunt nature of a validator. It's a yes/no response which allows or blocks the transition. You should NEVER change any data, inside Jira or in other systems in a validator, because you simply do not know if the transition is going to succeed.

Vio ao December 1, 2013

I want to give a message to user like that pop auimessage that when I create an issue.

I'm looking this:
https://developer.atlassian.com/display/JIRADEV/Creating+Workflow+Extensions#CreatingWorkflowExtensions-Part3.Createavalidator

Vio ao December 1, 2013

I just do something during the transition .It dosen't compact the result of the transition .
And then I need give a message to the user to show the result of this thing which is done during the
transition

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.
December 1, 2013

A validator is the wrong place to "do something during a transition". Your original question was the right place - you do things in post-functions. Validators are for checking input.

As we've already told you though, if you want feedback from a post-function, you need to write it on to the issue so that it will be displayed on the view screen. If you want to change the way that works, you will need to start hacking the core of Jira.

Like kklt xu likes this
Vio ao December 1, 2013

It is said that there is no way to implement whta I want?
Is there any way to show a dialog in postfunction?

Vio ao December 1, 2013

OK,I can't do what I want but thanks

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.
December 1, 2013

I think we've answered that several times already.

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.
December 1, 2013

Some of the answers include the way to get close - write the information to the issue, then the user will see it.

Vio ao December 1, 2013

I have implemented the close way.however, I don not satisfied with it.

0 votes
RambanamP
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.
December 1, 2013

this is not exactly what you are looking for but it will help you

https://developer.atlassian.com/display/JIRADEV/Displaying+Content+in+a+Dialog+in+JIRA

Vio ao December 1, 2013

I have a judgement in the postfunction.if it is false then I pop this message.
Can any method to implement it?

Suggest an answer

Log in or Sign up to answer