Forums

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

What will happen if I delete JIRA projects that shares a akey with Confluence?

Michal Bugajny _buGi_
April 23, 2020

I want to delete the JIRA project that shares the key with Confluence, because I wanted to test some options and now I am decided to use JIRA and start over again with issue numbering. I want to keep the Confluence and I am afraid that deleteing JIRA project will erase the Confluence. Are my worries justified?

 

2 answers

0 votes
Terry Beavers
Contributor
August 16, 2016

Hi @Nic Brough [Adaptavist],

I have a calculated field (Score) that I am trying to configure with a Behaviours script, so that it will set the priority based on this calculated Score, but it doesn't seem to work at all, nor do I see any output in my atlassian-jira.log file.  Could you please review and let me know what I am missing?

I am running JIRA 7.0.10 with ScriptRunner 4.3.5

Thank you in advance for your support.

import org.apache.log4j.Logger
import com.atlassian.jira.component.ComponentAccessor
def constantsManager = ComponentAccessor.getConstantsManager()
def scoreField = getFieldByName('Score')
def scoreVal = (Integer) scoreField.getValue()
log.info("DEBUG MESSAGE: scoreVal = $scoreVal")
if (scoreVal == 25) {
    def priority = constantsManager.priorityObjects.findByName("Emergency")
    getFieldById("priority").setFormValue(priority.id)
log.info("DEBUG MESSAGE: priority = $priority")
log.info("DEBUG MESSAGE: priority.id = $priority.id")
}
else if (scoreVal > 14 && scoreVal < 25) {
    def priority = constantsManager.priorityObjects.findByName("Critical")
    getFieldById("priority").setFormValue(priority.id)
log.info("DEBUG MESSAGE: priority = $priority")
log.info("DEBUG MESSAGE: priority.id = $priority.id")
}
else if (scoreVal > 5 && scoreVal < 15) {
    def priority = constantsManager.priorityObjects.findByName("Major")
    getFieldById("priority").setFormValue(priority.id)
log.info("DEBUG MESSAGE: priority = $priority")
log.info("DEBUG MESSAGE: priority.id = $priority.id")
}
else {
    def priority = constantsManager.priorityObjects.findByName("Minor")
    getFieldById("priority").setFormValue(priority.id)
log.info("DEBUG MESSAGE: priority = $priority")
log.info("DEBUG MESSAGE: priority.id = $priority.id")
}
0 votes
Nic Brough -Adaptavist-
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.
July 13, 2016

You'll need some scripting or code to do this probably.  What have you tried so far, and when do you want to apply this calculated priority?

maf suppport
July 13, 2016

At the time of creation of the Issue(incident). I tried adding the script to the description but it was not helpful. I am a novice here. So it was just a hit and trial

Nic Brough -Adaptavist-
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.
July 13, 2016

What script?  What add-on are you using?

maf suppport
July 13, 2016

i followed up following link:

https://confluence.atlassian.com/jira060/setting-priority-field-value-based-on-customfield-value-370705176.html.

But i didnt know which database is being used.

 

Nic Brough -Adaptavist-
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.
July 13, 2016

That's an old article and is becoming less and less appropriate - javascript in descriptions simply can't be recommended any more.  Also, that script is for plain Jira, I don't think it even functions in Service Desk

If you are going to insist on doing this way, you don't need the database access.  Go to the list of custom fields, find the one you're interested in, then hover the cursor over one of the links (configure, edit, delete etc).  The url the browser shows you contains a section saying id=12345 - that number is the id you need.

 

maf suppport
July 14, 2016

Can you give an example of doing it in some other way.

Nic Brough -Adaptavist-
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.
July 14, 2016

I'd use the script runner to write a post-function to set it - reading a custom field and setting other fields is covered in the documentation.

Suggest an answer

Log in or Sign up to answer